Fix libusb_get_device_list return value
It was documented to return the list length, but was returning 0.
diff --git a/examples/lsusb.c b/examples/lsusb.c
index 9aad2bf..193b23a 100644
--- a/examples/lsusb.c
+++ b/examples/lsusb.c
@@ -39,14 +39,15 @@
{
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);