summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2021-01-05 12:35:40 +0100
committerPali Rohár <pali.rohar@gmail.com>2021-01-05 12:35:40 +0100
commit93bd73d45131893328b30e186993d518c04ef256 (patch)
tree9167677560202640cbe2bb1387b570b5ed4c55fc
parent0e5ceffa421c5d667e74641f864ac99109908f7d (diff)
download0xFFFF-93bd73d45131893328b30e186993d518c04ef256.tar.bz2
usb-device: Fix iterating over supported list of devices
-rw-r--r--src/usb-device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/usb-device.c b/src/usb-device.c
index 7ce71e5..faee3eb 100644
--- a/src/usb-device.c
+++ b/src/usb-device.c
@@ -154,11 +154,11 @@ static void usb_descriptor_info_print(usb_dev_handle * udev, struct usb_device *
static struct usb_device_info * usb_device_is_valid(struct usb_device * dev) {
- int i;
+ size_t i;
char product[1024];
struct usb_device_info * ret = NULL;
- for ( i = 0; usb_devices[i].vendor; ++i ) {
+ for ( i = 0; i < sizeof(usb_devices)/sizeof(usb_devices[0]); ++i ) {
if ( dev->descriptor.idVendor == usb_devices[i].vendor && dev->descriptor.idProduct == usb_devices[i].product ) {