From 68619a9de71e9ee26bca3b6a86b22c11e720b91d Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Wed, 5 Apr 2017 18:21:39 +0000 Subject: Replace memcpy with memmove in el_substitute (copying into the same string!) --- src/libexecline/el_substitute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libexecline/el_substitute.c b/src/libexecline/el_substitute.c index 6f50c2c..5eff6d3 100644 --- a/src/libexecline/el_substitute.c +++ b/src/libexecline/el_substitute.c @@ -70,7 +70,7 @@ static ssize_t parseword (stralloc *sa, genalloc *list, char const *s, char cons sa->len -= esc >> 1 ; offset += esc >> 1 ; if (esc & 1) { - memcpy(sa->s + mark - offset - 2 - supp, sa->s + mark - offset + (esc>>1) - 1 - supp, pos - mark + 1 + supp) ; + memmove(sa->s + mark - offset - 2 - supp, sa->s + mark - offset + (esc>>1) - 1 - supp, pos - mark + 1 + supp) ; sa->len-- ; offset++ ; } else -- cgit v1.2.3