summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/system.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/system.c b/src/system.c
index c6bc52d..5fd6062 100644
--- a/src/system.c
+++ b/src/system.c
@@ -71,7 +71,9 @@ void *mempcpy(void *dest, const void *src, size_t n)
 #ifndef HAVE_STPCPY
 char *stpcpy(char *dest, const char *src)
 {
-	return mempcpy(dest, src, strlen(src) + 1);
+	size_t len = strlen(src);
+	dest[len] = 0;
+	return mempcpy(dest, src, len);
 }
 #endif