aboutsummaryrefslogtreecommitdiff
path: root/jim.c
diff options
context:
space:
mode:
Diffstat (limited to 'jim.c')
-rw-r--r--jim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/jim.c b/jim.c
index fba93cb..8806ec4 100644
--- a/jim.c
+++ b/jim.c
@@ -684,8 +684,8 @@ char *Jim_StrDupLen(const char *s, int l)
{
char *copy = Jim_Alloc(l + 1);
- memcpy(copy, s, l + 1);
- copy[l] = 0; /* Just to be sure, original could be substring */
+ memcpy(copy, s, l);
+ copy[l] = 0; /* NULL terminate */
return copy;
}