aboutsummaryrefslogtreecommitdiffstats
path: root/src/string/strn/strncpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/strn/strncpy.c')
-rw-r--r--src/string/strn/strncpy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string/strn/strncpy.c b/src/string/strn/strncpy.c
index f3eba84..3a1e66b 100644
--- a/src/string/strn/strncpy.c
+++ b/src/string/strn/strncpy.c
@@ -37,7 +37,7 @@ char* strncpy(char* restrict whither, const char* restrict whence, size_t maxlen
{
size_t n = strnlen(whence, maxlen);
memcpy(whither, whence, n);
- memset(whither, 0, maxlen - n);
+ memset(whither + n, 0, maxlen - n);
return whither;
}