From: Gurusamy Sarathy Date: Thu, 20 May 1999 05:18:26 +0000 (+0000) Subject: various little nits X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=db7c17d71cacfc5af407f4e30ddbc409ecd03112;p=p5sagit%2Fp5-mst-13.2.git various little nits p4raw-id: //depot/perl@3436 --- diff --git a/doop.c b/doop.c index 4e5866e..ec14a76 100644 --- a/doop.c +++ b/doop.c @@ -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 05e70c8..9f987fd 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 04ab842..f60f91a 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 2a306f2..b6bc8de 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); } diff --git a/os2/os2.c b/os2/os2.c index 3103012..7f011f7 100644 --- a/os2/os2.c +++ b/os2/os2.c @@ -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 1213231..72b4192 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1798,15 +1798,7 @@ Say C 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 -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 to translate to the number of seconds which need to be added to UTC to diff --git a/pp.c b/pp.c index afee215..42fd9b8 100644 --- a/pp.c +++ b/pp.c @@ -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 458ff9a..e52ba6d 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 2fe8772..53048cb 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 24b86aa..ab76fbe 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);