| Submitter | Stefan Hajnoczi |
|---|---|
| Date | Jan. 11, 2013, 9:18 a.m. |
| Message ID | <1357895886-14283-2-git-send-email-stefanha@redhat.com> |
| Download | mbox | patch |
| Permalink | /patch/211263/ |
| State | New |
| Headers | show |
Comments
Patch
diff --git a/readline.c b/readline.c index 5fc9643..a0c9638 100644 --- a/readline.c +++ b/readline.c @@ -248,8 +248,8 @@ static void readline_hist_add(ReadLineState *rs, const char *cmdline) if (idx == READLINE_MAX_CMDS) { /* Need to get one free slot */ free(rs->history[0]); - memcpy(rs->history, &rs->history[1], - (READLINE_MAX_CMDS - 1) * sizeof(char *)); + memmove(rs->history, &rs->history[1], + (READLINE_MAX_CMDS - 1) * sizeof(char *)); rs->history[READLINE_MAX_CMDS - 1] = NULL; idx = READLINE_MAX_CMDS - 1; }