Michael Tokarev wrote:
Michael Tokarev wrote:
Mark McLoughlin wrote:
[]
--- qemu/net.c
+++ qemu/net.c
@@ -1740,7 +1740,7 @@ void net_cleanup(void)
                 TAPState *s = vc->opaque;
if (strcmp(vc->model, "tap") == 0 &&
-                    sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&
+                    sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 &&
Hmm.  What if ifname=foo is the last parameter?

And while we're at it.. Why the parsing isn't done like this:

  for(tok = strtok(arg, ","); tok; tok = strtok(NULL, ",")) {
    if (strncmp(tok, "ifname=", 7) == 0)
      strcpy(ifname, tok+7);
    else if ...
  }

Because strtok is extremely evil.

Regards,

Anthony Liguori

-- here and everywhere else?

/mjt
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to