]> git.proxmox.com Git - mirror_qemu.git/blobdiff - qemu-sockets.c
Merge remote-tracking branch 'stefanha/block' into staging
[mirror_qemu.git] / qemu-sockets.c
index cfed9c5a5bd9e14b68015a1be2f909eabfa73cc6..d314cf1d1bad66e8299c9b6266b25d2a94ff01dc 100644 (file)
@@ -529,8 +529,9 @@ static InetSocketAddress *inet_parse(const char *str, Error **errp)
     optstr = str + pos;
     h = strstr(optstr, ",to=");
     if (h) {
-        if (1 != sscanf(str, "%d%n", &to, &pos) ||
-            (str[pos] != '\0' && str[pos] != ',')) {
+        h += 4;
+        if (sscanf(h, "%d%n", &to, &pos) != 1 ||
+            (h[pos] != '\0' && h[pos] != ',')) {
             error_setg(errp, "error parsing to= argument");
             goto fail;
         }