diff options
author | Daniel Drake <dsd@gentoo.org> | 2008-05-04 00:51:59 +0100 |
---|---|---|
committer | Daniel Drake <dsd@gentoo.org> | 2008-05-04 00:51:59 +0100 |
commit | 5878daa85e3364bb3885190425d4f9deaa2d8c36 (patch) | |
tree | 12b7ece4e65b58b7d36b6e9dc07af14ab285e61c /examples | |
parent | a74106a9b48b88bae0e099be34a18d653a8f1238 (diff) | |
download | libusb-5878daa85e3364bb3885190425d4f9deaa2d8c36.tar.gz |
Fix libusb_get_device_list return value
It was documented to return the list length, but was returning 0.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/lsusb.c | 7 |
1 files changed, 4 insertions, 3 deletions
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 @@ 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); |