summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/util.c b/util.c
index d0d8454b86..feef339893 100644
--- a/util.c
+++ b/util.c
@@ -3616,7 +3616,7 @@ Perl_sv_getcwd(pTHX_ register SV *sv)
SvPOK_off(sv);
New(0, buf, MAXPATHLEN, char);
if (buf) {
- buf[MAXPATHLEN] = 0;
+ buf[MAXPATHLEN - 1] = 0;
/* Yes, some getcwd()s automatically allocate a buffer
* if given a NULL one. Portability is the problem.
* XXX Configure probe needed. */