mirror of
https://github.com/erjiang/usbscale.git
synced 2025-06-29 17:40:59 -06:00
Fix duplicate scale detection in find_nth_scale
This commit is contained in:
parent
efccef3334
commit
219c9b4ec2
@ -463,8 +463,8 @@ static libusb_device* find_nth_scale(libusb_device **devs, int index)
|
||||
uint16_t last_device_address = 0;
|
||||
|
||||
//
|
||||
// Loop through each USB device, and for each device, loop through the
|
||||
// scales list to see if it's one of our listed scales.
|
||||
// Loop through each USB device and check if it's one of the
|
||||
// supported scales listed in scales.h.
|
||||
//
|
||||
while ((dev = devs[i++]) != NULL) {
|
||||
|
||||
@ -474,8 +474,6 @@ static libusb_device* find_nth_scale(libusb_device **devs, int index)
|
||||
fprintf(stderr, "failed to get device descriptor");
|
||||
return NULL;
|
||||
}
|
||||
int i;
|
||||
for (i = 0; i < NSCALES; i++) {
|
||||
if (is_scale(desc.idVendor, desc.idProduct)) {
|
||||
|
||||
// Skip this device if it's the same as the last one.
|
||||
@ -522,7 +520,6 @@ static libusb_device* find_nth_scale(libusb_device **devs, int index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user