sr_usb_find(): Increase the 'bus' limit to 255.

On some systems it can happen that the USB 'bus' number is a lot larger
than 64, but sr_usb_find() currently errors out if it is > 64.

Example:
Bus 250 Device 006: ID 1ab1:04ce 1ab1 DS1000Z Series[...]

Increase that limit so that the code will work everywhere. This bus number
is queried via libusb_get_bus_number() which returns an uint8_t, so we're
limiting to 255 here.

Thanks to 'ssi' on IRC for reporting the issue.
This commit is contained in:
Uwe Hermann 2015-11-21 20:27:25 +01:00
parent d79244dc34
commit e4ce146fef
1 changed files with 1 additions and 1 deletions

View File

@ -359,7 +359,7 @@ SR_PRIV GSList *sr_usb_find(libusb_context *usb_ctx, const char *conn)
return NULL; return NULL;
} }
if (bus > 64) { if (bus > 255) {
sr_err("Invalid bus specified: %d.", bus); sr_err("Invalid bus specified: %d.", bus);
return NULL; return NULL;
} }