summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/getcwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/getcwd.c')
-rw-r--r--libc/sysdeps/linux/common/getcwd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/getcwd.c b/libc/sysdeps/linux/common/getcwd.c
index 165ea317e..d52792994 100644
--- a/libc/sysdeps/linux/common/getcwd.c
+++ b/libc/sysdeps/linux/common/getcwd.c
@@ -165,7 +165,7 @@ int __syscall_getcwd(char * buf, unsigned long size)
cwd = recurser(buf, size, st.st_dev, st.st_ino);
if (cwd) {
- len = strlen(buf);
+ len = strlen(buf) + 1;
__set_errno(olderrno);
}
return len;