summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/misc.c b/src/misc.c
index 633efd63b..68c470192 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -160,7 +160,7 @@ char *strnrepl(char *s, int32 size, const char *old, const char *new)
if (diff > avail)
break;
if (diff != 0)
- memmove(ptr + oldlen + diff, ptr + oldlen, left + 1);
+ memmove(ptr + oldlen + diff, ptr + oldlen, left + 1 - oldlen);
strncpy(ptr, new, newlen);
ptr += newlen;
left -= oldlen;