From: Mike Meyer Date: Mon, 11 Jul 2016 16:09:04 +0000 (-0500) Subject: hantek-6xxx: Fix the device scan to not scan the NULL entry. X-Git-Tag: libsigrok-0.5.0~279 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0d8a3063e315064ff73f154ea7d94acb41fe8ba6;p=libsigrok.git hantek-6xxx: Fix the device scan to not scan the NULL entry. --- diff --git a/src/hardware/hantek-6xxx/api.c b/src/hardware/hantek-6xxx/api.c index cbcd15bf..c3f3d881 100644 --- a/src/hardware/hantek-6xxx/api.c +++ b/src/hardware/hantek-6xxx/api.c @@ -219,7 +219,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options) usb_get_port_path(devlist[i], connection_id, sizeof(connection_id)); prof = NULL; - for (j = 0; j < (int)ARRAY_SIZE(dev_profiles); j++) { + for (j = 0; dev_profiles[j].orig_vid; j++) { if (des.idVendor == dev_profiles[j].orig_vid && des.idProduct == dev_profiles[j].orig_pid) { /* Device matches the pre-firmware profile. */