]> git.proxmox.com Git - qemu.git/blobdiff - readline.c
target-i386: Add "feature-words" property to X86CPU
[qemu.git] / readline.c
index 5fc9643c2bf23a22822594e92ae5c19e7faef6df..d6e04d4796ccc5f1e3e7f4a7d2883bcfc004d1f3 100644 (file)
@@ -247,14 +247,14 @@ 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 *));
+        g_free(rs->history[0]);
+       memmove(rs->history, &rs->history[1],
+               (READLINE_MAX_CMDS - 1) * sizeof(char *));
        rs->history[READLINE_MAX_CMDS - 1] = NULL;
        idx = READLINE_MAX_CMDS - 1;
     }
     if (new_entry == NULL)
-       new_entry = strdup(cmdline);
+        new_entry = g_strdup(cmdline);
     rs->history[idx] = new_entry;
     rs->hist_entry = -1;
 }