diff options
Diffstat (limited to 'devices.c')
-rw-r--r-- | devices.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -361,10 +361,17 @@ void devices_parse_info_usbhost(struct qemu_window *win, char *str) " %31[^:]: USB device %x:%x, %63[^\r\n]%n", device, speed, class, &vendor, &product, name, &len); if (rc != 6) { - /* parse error, try to skip line */ - if (0 == (len = skip_line(str, pos))) - break; - continue; + strcpy(name, "no name"); + rc = sscanf(str+pos, + " Device %15[^,], speed %15s Mb/s\n" + " %31[^:]: USB device %x:%x%n", + device, speed, class, &vendor, &product, &len); + if (rc != 5) { + /* parse error, try to skip line */ + if (0 == (len = skip_line(str, pos))) + break; + continue; + } } while (str[pos+len] == '\r' || str[pos+len] == '\n') len++; |