xl: fix strtok() call in vif2 parsing
authorAndre Przywara <andre.przywara@amd.com>
Tue, 24 Aug 2010 17:18:20 +0000 (18:18 +0100)
committerAndre Przywara <andre.przywara@amd.com>
Tue, 24 Aug 2010 17:18:20 +0000 (18:18 +0100)
Fix fixes a hang when parsing the vif2 parameter.

According to the manpage subsequent calls to strtok() must use
NULL in the string parameter to keep the iteration going.

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/xl_cmdimpl.c

index c837e549b6fd6e5ffb844839d161defe4762830b..64f7087c203f2e96ce229f201794fd745d047a89 100644 (file)
@@ -883,7 +883,7 @@ skip:
 
             init_net2_info(net2, d_config->num_vif2s);
 
-            for (p = strtok(buf2, ","); p; p = strtok(buf2, ",")) {
+            for (p = strtok(buf2, ","); p; p = strtok(NULL, ",")) {
                 while (isblank(*p))
                     p++;
                 if (!strncmp("front_mac=", p, 10)) {