summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/extstr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/extstr.c b/src/common/extstr.c
index 2e69e3f..43a5ec9 100644
--- a/src/common/extstr.c
+++ b/src/common/extstr.c
@@ -196,13 +196,13 @@ char *strrpl(char *haystack, const char *needle1, const char *needle2)
haystack = (char *)realloc(haystack, inlen * sizeof(char *));
found = haystack + index;
- memmove(found + len1, found + len2, inlen - index + len2);
+ memmove(found + len2, found + len1, inlen + len2 - index);
}
else if (len2 < len1)
{
- memmove(found + len2, found + len1, inlen - index - len1);
+ memmove(found + len2, found + len1, inlen + len2 - index);
inlen -= (len1 - len2);