]> Git Repo - qemu.git/blobdiff - monitor.c
Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging
[qemu.git] / monitor.c
index 0988eb47888eafb863e3caadb0f1671f8f8e85f7..7b473aad1f481412e8cf8df9958dc1f37fbb6883 100644 (file)
--- a/monitor.c
+++ b/monitor.c
@@ -820,9 +820,7 @@ static int compare_cmd(const char *name, const char *list)
     p = list;
     for(;;) {
         pstart = p;
-        p = strchr(p, '|');
-        if (!p)
-            p = pstart + strlen(pstart);
+        p = qemu_strchrnul(p, '|');
         if ((p - pstart) == len && !memcmp(pstart, name, len))
             return 1;
         if (*p == '\0')
@@ -3491,9 +3489,7 @@ static void cmd_completion(Monitor *mon, const char *name, const char *list)
     p = list;
     for(;;) {
         pstart = p;
-        p = strchr(p, '|');
-        if (!p)
-            p = pstart + strlen(pstart);
+        p = qemu_strchrnul(p, '|');
         len = p - pstart;
         if (len > sizeof(cmd) - 2)
             len = sizeof(cmd) - 2;
This page took 0.024015 seconds and 4 git commands to generate.