summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Orivel <bastien.orivel@diateam.net>2021-04-16 13:57:20 +0200
committerFrediano Ziglio <freddy77@gmail.com>2021-04-17 09:57:24 +0100
commit2fca24cc239237c3d1dc82d381eb67df413ed049 (patch)
tree0eabce523ccf22484c6019ebbf6cda3193e4f4c2
parent8f4e35a25ea14992b21c02ed832cd8185a08ba60 (diff)
Fix parsing the usbids file
This fixes a regression from 032ca202f839fe1c49cddfd2b0459f9fecc23c86 where a check on whether the usbids file contained anything but the wrong variable was checked. This is visible on windows when trying to share a USB device as devices won't get named based on the usbids file. Same thing on linux if we can't read the name from the sysfs. `usbids_vendor_info` is only initialized to something not NULL after it was checked to be different from NULL which is obviously wrong. The patch wanted to check that the `usbids_vendor_count` was different from 0 instead. Acked-by: Frediano Ziglio <freddy77@gmail.com>
-rw-r--r--src/usbutil.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/usbutil.c b/src/usbutil.c
index f29302b..b34739e 100644
--- a/src/usbutil.c
+++ b/src/usbutil.c
@@ -113,7 +113,7 @@ static gboolean spice_usbutil_parse_usbids(gchar *path)
usbids_vendor_count++;
}
- if (usbids_vendor_info == 0 || product_count == 0) {
+ if (usbids_vendor_count == 0 || product_count == 0) {
usbids_vendor_count = -1;
g_strfreev(lines);
g_free(contents);