]> git.proxmox.com Git - qemu.git/blobdiff - readline.c
target-i386: Add "feature-words" property to X86CPU
[qemu.git] / readline.c
index 540cd8a025d145dd3fe28e538bd79f9198e9c5fc..d6e04d4796ccc5f1e3e7f4a7d2883bcfc004d1f3 100644 (file)
@@ -21,8 +21,8 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  */
-#include "readline.h"
-#include "monitor.h"
+#include "monitor/readline.h"
+#include "monitor/monitor.h"
 
 #define IS_NORM 0
 #define IS_ESC  1
@@ -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;
 }