Fix libusb_get_device_list return value
It was documented to return the list length, but was returning 0.
This commit is contained in:
parent
a74106a9b4
commit
5878daa85e
3 changed files with 17 additions and 10 deletions
|
@ -39,14 +39,15 @@ int main(void)
|
|||
{
|
||||
libusb_device **devs;
|
||||
int r;
|
||||
size_t cnt;
|
||||
|
||||
r = libusb_init();
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = libusb_get_device_list(&devs);
|
||||
if (r < 0)
|
||||
return r;
|
||||
cnt = libusb_get_device_list(&devs);
|
||||
if (cnt < 0)
|
||||
return (int) cnt;
|
||||
|
||||
print_devs(devs);
|
||||
libusb_free_device_list(devs, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue