From: Jarkko Hietaniemi Date: Wed, 13 Jun 2001 02:10:16 +0000 (+0000) Subject: VMS DEC C compiler found nits by Peter Prymmer. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ce8217e0ee91404d9ead31e9161c90ae176fd05b;p=p5sagit%2Fp5-mst-13.2.git VMS DEC C compiler found nits by Peter Prymmer. p4raw-id: //depot/perl@10553 --- diff --git a/util.c b/util.c index 945172e..91bbc0b 100644 --- a/util.c +++ b/util.c @@ -4940,9 +4940,10 @@ Perl_sv_realpath(pTHX_ SV *sv, char *path, STRLEN len) #ifndef PERL_MICRO char name[MAXPATHLEN] = { 0 }, *s; STRLEN pathlen, namelen; + const char zero = '\0'; /* Don't use strlen() to avoid running off the end. */ - s = memchr(path, '\0', MAXPATHLEN); + s = memchr(path, zero, MAXPATHLEN); pathlen = s ? s - path : MAXPATHLEN; #ifdef HAS_REALPATH @@ -4966,7 +4967,7 @@ Perl_sv_realpath(pTHX_ SV *sv, char *path, STRLEN len) /* Is the destination buffer too long? * Don't use strlen() to avoid running off the end. */ - s = memchr(name, '\0', MAXPATHLEN); + s = memchr(name, zero, MAXPATHLEN); namelen = s ? s - name : MAXPATHLEN; if (namelen == MAXPATHLEN) { Perl_warn(aTHX_ "sv_realpath: realpath(\"%s\"): %c= (MAXPATHLEN = %d)",