From 98b0828c63a5e77ad313896029c854b0c3721cc9 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Thu, 26 Sep 2013 21:24:58 -0700 Subject: [PATCH] 31770: memmove() instead of memcpy() for overlapping regions. --- ChangeLog | 5 +++++ Src/hist.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e7106e13f..3fd805473 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-09-26 Barton E. Schaefer + + * 31770: Src/hist.c: memmove() instead of memcpy() for overlapping + regions. + 2013-09-25 Peter Stephenson * 31765: Src/Zle/zle_main.c: on entry to editor, if starting in diff --git a/Src/hist.c b/Src/hist.c index f78c97d8f..3d6068e51 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -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; }