aboutsummaryrefslogtreecommitdiffstats
path: root/devices.c
diff options
context:
space:
mode:
Diffstat (limited to 'devices.c')
-rw-r--r--devices.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/devices.c b/devices.c
index 872afdd..6fbde73 100644
--- a/devices.c
+++ b/devices.c
@@ -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++;