diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-04-05 18:21:39 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-04-05 18:21:39 +0000 |
commit | 68619a9de71e9ee26bca3b6a86b22c11e720b91d (patch) | |
tree | bfa20422053f5617aa1f4531f5a8268195a2c18c | |
parent | b453f1086761a41f874d017b901ffeeea2c0c8e5 (diff) | |
download | execline-68619a9de71e9ee26bca3b6a86b22c11e720b91d.tar.xz |
Replace memcpy with memmove in el_substitute (copying into the same string!)
-rw-r--r-- | src/libexecline/el_substitute.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 |