diff options
Diffstat (limited to 'source/lib/util.c')
-rw-r--r-- | source/lib/util.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index 3bee53abbcc..b3eef430f11 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -1187,7 +1187,9 @@ char *readdirname(DIR *p) { static pstring buf; - memcpy(buf, dname, NAMLEN(ptr)+1); + int len = NAMLEN(ptr); + memcpy(buf, dname, len); + buf[len] = 0; dname = buf; } |