[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] inet_parse: fix ,to= parsing
From: |
Stefano Stabellini |
Subject: |
[Qemu-devel] [PATCH] inet_parse: fix ,to= parsing |
Date: |
Wed, 21 Nov 2012 18:28:28 +0000 |
User-agent: |
Alpine 2.02 (DEB 1266 2009-07-14) |
Fix inet_parse to parse the ",to=" command line option correctly.
Signed-off-by: Stefano Stabellini <address@hidden>
diff --git a/qemu-sockets.c b/qemu-sockets.c
index cfed9c5..f8740dd 100644
--- a/qemu-sockets.c
+++ b/qemu-sockets.c
@@ -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 (1 != sscanf(h, "%d%n", &to, &pos) ||
+ (h[pos] != '\0' && h[pos] != ',')) {
error_setg(errp, "error parsing to= argument");
goto fail;
}
- [Qemu-devel] [PATCH] inet_parse: fix ,to= parsing,
Stefano Stabellini <=