summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/util.c b/util.c
index 945172e1da..91bbc0b523 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)",