On Wed, 2009-01-14 at 00:01 +0300, Michael Tokarev wrote:
> Anthony Liguori wrote:
> >> Michael Tokarev wrote:
> ...
> >>>>        if (strcmp(vc->model, "tap") == 0 &&
> >>>> -          sscanf(vc->info_str, "ifname=%63s ", ifname) == 1 &&
> >>>> +          sscanf(vc->info_str, "ifname=%63s,", ifname) == 1 &&
> >>
> >> 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.
> 
> I didn't mean strtok, but the way -- something LIKE that, i.e,
> by splitting the string into args and parsing each in turn.

It shouldn't be parsing anything at all, it's a stupid lame hack.

I fixed it with:

  http://git.kernel.org/?p=virt/qemu/qemu.git;a=commit;h=973cbd37ce

Cheers,
Mark.

--
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