qemu-sockets: Fix parsing of the inet option 'to'.
Having a qemu command line argument like "-vnc 127.0.0.1:0,to=99" is broken.
This have been break with commit 879e45c72d
.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: malc <av1474@comtv.ru>
This commit is contained in:
parent
ecf51c9abe
commit
1ccbc28512
|
@ -529,8 +529,9 @@ static InetSocketAddress *inet_parse(const char *str, Error **errp)
|
||||||
optstr = str + pos;
|
optstr = str + pos;
|
||||||
h = strstr(optstr, ",to=");
|
h = strstr(optstr, ",to=");
|
||||||
if (h) {
|
if (h) {
|
||||||
if (1 != sscanf(str, "%d%n", &to, &pos) ||
|
h += 4;
|
||||||
(str[pos] != '\0' && str[pos] != ',')) {
|
if (sscanf(h, "%d%n", &to, &pos) != 1 ||
|
||||||
|
(h[pos] != '\0' && h[pos] != ',')) {
|
||||||
error_setg(errp, "error parsing to= argument");
|
error_setg(errp, "error parsing to= argument");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue