diff options
-rw-r--r-- | doop.c | 2 | ||||
-rw-r--r-- | ext/SDBM_File/sdbm/dba.c | 3 | ||||
-rw-r--r-- | ext/SDBM_File/sdbm/dbd.c | 3 | ||||
-rw-r--r-- | ext/SDBM_File/sdbm/dbe.c | 7 | ||||
-rw-r--r-- | os2/os2.c | 10 | ||||
-rw-r--r-- | pod/perldiag.pod | 10 | ||||
-rw-r--r-- | pp.c | 2 | ||||
-rw-r--r-- | win32/perlhost.h | 7 | ||||
-rw-r--r-- | win32/win32.c | 13 | ||||
-rw-r--r-- | x2p/walk.c | 4 |
10 files changed, 35 insertions, 26 deletions
@@ -665,7 +665,7 @@ do_join(register SV *sv, SV *del, register SV **mark, register SV **sp) SvGROW(sv, len + 1); /* so try to pre-extend */ mark = oldmark; - items = sp - mark;; + items = sp - mark; ++mark; } diff --git a/ext/SDBM_File/sdbm/dba.c b/ext/SDBM_File/sdbm/dba.c index 05e70c8961..9f987fd88e 100644 --- a/ext/SDBM_File/sdbm/dba.c +++ b/ext/SDBM_File/sdbm/dba.c @@ -23,6 +23,9 @@ char **argv; if (p = argv[1]) { name = (char *) malloc((n = strlen(p)) + 5); + if (!name) + oops("cannot get memory"); + strcpy(name, p); strcpy(name + n, ".pag"); diff --git a/ext/SDBM_File/sdbm/dbd.c b/ext/SDBM_File/sdbm/dbd.c index 04ab842e2d..f60f91a5f5 100644 --- a/ext/SDBM_File/sdbm/dbd.c +++ b/ext/SDBM_File/sdbm/dbd.c @@ -26,6 +26,9 @@ char **argv; if (p = argv[1]) { name = (char *) malloc((n = strlen(p)) + 5); + if (!name) + oops("cannot get memory"); + strcpy(name, p); strcpy(name + n, ".pag"); diff --git a/ext/SDBM_File/sdbm/dbe.c b/ext/SDBM_File/sdbm/dbe.c index 2a306f276e..b6bc8deba8 100644 --- a/ext/SDBM_File/sdbm/dbe.c +++ b/ext/SDBM_File/sdbm/dbe.c @@ -161,6 +161,9 @@ char *s; db.dsize = 0; db.dptr = (char *) malloc(strlen(s) * sizeof(char)); + if (!db.dptr) + oops("cannot get memory"); + for (p = db.dptr; *s != '\0'; p++, db.dsize++, s++) { if (*s == '\\') { if (*++s == 'n') @@ -198,6 +201,8 @@ datum db; char *p1, *p2; buf = (char *) malloc((db.dsize + 1) * sizeof(char)); + if (!buf) + oops("cannot get memory"); for (p1 = buf, p2 = db.dptr; *p2 != '\0'; *p1++ = *p2++); *p1 = '\0'; return buf; @@ -285,7 +290,7 @@ char **argv; } } - if (giveusage | what == YOW | argn < 1) { + if (giveusage || what == YOW || argn < 1) { fprintf(stderr, "Usage: %s databse [-m r|w|rw] [-crtx] -a|-d|-f|-F|-s [key [content]]\n", argv[0]); exit(-1); } @@ -1240,10 +1240,12 @@ settmppath() if (!p) return; len = strlen(p); tpath = (char *)malloc(len + strlen(TMPPATH1) + 2); - strcpy(tpath, p); - tpath[len] = '/'; - strcpy(tpath + len + 1, TMPPATH1); - tmppath = tpath; + if (tpath) { + strcpy(tpath, p); + tpath[len] = '/'; + strcpy(tpath + len + 1, TMPPATH1); + tmppath = tpath; + } } #include "XSUB.h" diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 1213231051..72b419294e 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1798,15 +1798,7 @@ Say C<kill -l> in your shell to see the valid signal names on your system. =item no UTC offset information; assuming local time is UTC -(S) A warning peculiar to VMS. Per was unable to find the local -timezone offset, so it's assuming that local system time is equivalent -to UTC. If it's not, define the logical name F<SYS$TIMEZONE_DIFFERENTIAL> -to translate to the number of seconds which need to be added to UTC to -get local time. - -=item no UTC offset information; assuming local time is UTC - -(S) A warning peculiar to VMS. Per was unable to find the local +(S) A warning peculiar to VMS. Perl was unable to find the local timezone offset, so it's assuming that local system time is equivalent to UTC. If it's not, define the logical name F<SYS$TIMEZONE_DIFFERENTIAL> to translate to the number of seconds which need to be added to UTC to @@ -4692,7 +4692,7 @@ PP(pp_pack) { char buf[1 + sizeof(UV)]; char *in = buf + sizeof(buf); - UV auv = U_V(adouble);; + UV auv = U_V(adouble); do { *--in = (auv & 0x7f) | 0x80; diff --git a/win32/perlhost.h b/win32/perlhost.h index 458ff9afc9..e52ba6d419 100644 --- a/win32/perlhost.h +++ b/win32/perlhost.h @@ -593,9 +593,10 @@ public: } if (0 == dwLen) { sMsg = (char*)LocalAlloc(0, 64/**sizeof(TCHAR)*/); - dwLen = sprintf(sMsg, - "Unknown error #0x%lX (lookup 0x%lX)", - dwErr, GetLastError()); + if (sMsg) + dwLen = sprintf(sMsg, + "Unknown error #0x%lX (lookup 0x%lX)", + dwErr, GetLastError()); } }; virtual void FreeBuf(char* sMsg) diff --git a/win32/win32.c b/win32/win32.c index 2fe8772d65..53048cb200 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1716,12 +1716,15 @@ win32_str_os_error(void *sv, DWORD dwErr) } if (0 == dwLen) { sMsg = (char*)LocalAlloc(0, 64/**sizeof(TCHAR)*/); - dwLen = sprintf(sMsg, - "Unknown error #0x%lX (lookup 0x%lX)", - dwErr, GetLastError()); + if (sMsg) + dwLen = sprintf(sMsg, + "Unknown error #0x%lX (lookup 0x%lX)", + dwErr, GetLastError()); + } + if (sMsg) { + sv_setpvn((SV*)sv, sMsg, dwLen); + LocalFree(sMsg); } - sv_setpvn((SV*)sv, sMsg, dwLen); - LocalFree(sMsg); } diff --git a/x2p/walk.c b/x2p/walk.c index 24b86aab50..ab76fbef74 100644 --- a/x2p/walk.c +++ b/x2p/walk.c @@ -1292,7 +1292,7 @@ sub Pick {\n\ if (len > 0) tmpstr = walk(1,level,ops[node+1].ival,&numarg,P_MIN); else - tmpstr = str_new(0);; + tmpstr = str_new(0); if (!tmpstr->str_ptr || !*tmpstr->str_ptr) { if (lval_field) { t = saw_OFS ? "$," : "' '"; @@ -1417,7 +1417,7 @@ sub Pick {\n\ str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN)); str_free(fstr); if (str->str_ptr[str->str_cur - 1] == '\n') - --str->str_cur;; + --str->str_cur; str_cat(str," while ("); str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN)); str_free(fstr); |