1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-19 11:31:26 +01:00

31770: memmove() instead of memcpy() for overlapping regions.

This commit is contained in:
Barton E. Schaefer 2013-09-26 21:24:58 -07:00
parent 0ed3c5ccd0
commit 98b0828c63
2 changed files with 6 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2013-09-26 Barton E. Schaefer <schaefer@zsh.org>
* 31770: Src/hist.c: memmove() instead of memcpy() for overlapping
regions.
2013-09-25 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 31765: Src/Zle/zle_main.c: on entry to editor, if starting in

View file

@ -953,7 +953,7 @@ histreduceblanks(void)
len = chwords[i+1] - chwords[i];
needblank = (i < chwordpos-2 && chwords[i+2] > chwords[i+1]);
if (pos != chwords[i]) {
memcpy(chline + pos, chline + chwords[i], len + needblank);
memmove(chline + pos, chline + chwords[i], len + needblank);
chwords[i] = pos;
chwords[i+1] = chwords[i] + len;
}