summary refs log tree commit diff
path: root/Src/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/string.c')
-rw-r--r--Src/string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/string.c b/Src/string.c
index a8da14fe0..9e14ef949 100644
--- a/Src/string.c
+++ b/Src/string.c
@@ -52,7 +52,8 @@ dupstring_wlen(const char *s, unsigned len)
     if (!s)
 	return NULL;
     t = (char *) zhalloc(len + 1);
-    strcpy(t, s);
+    memcpy(t, s, len);
+    t[len] = '\0';
     return t;
 }