summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
Diffstat (limited to 'libc')
-rw-r--r--libc/unistd/getlogin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/unistd/getlogin.c b/libc/unistd/getlogin.c
index c762c366e..6db73ae1c 100644
--- a/libc/unistd/getlogin.c
+++ b/libc/unistd/getlogin.c
@@ -42,7 +42,7 @@ int getlogin_r(char *name, size_t len)
return -1;
strncpy(name, foo, len);
- name[len] = '\0';
+ name[len-1] = '\0';
return 0;
}