Problem detected by the Coverity tool
CID 1042538 (#1 of 1): Unchecked return value (CHECKED_RETURN)4.
check_return: Calling function "libusb_init(libusb_context **)" without
checking return value (as is done elsewhere 11 out of 12 times).
product_id = (argc > 2) ? strtol (argv[2], NULL, 0) : 0x5005;
class_id = (argc > 3) ? strtol (argv[3], NULL, 0) : LIBUSB_HOTPLUG_MATCH_ANY;
- libusb_init (NULL);
+ rc = libusb_init (NULL);
+ if (rc < 0)
+ {
+ printf("failed to initialise libusb: %s\n", libusb_error_name(rc));
+ return EXIT_FAILURE;
+ }
if (!libusb_has_capability (LIBUSB_CAP_HAS_HOTPLUG)) {
printf ("Hotplug capabilites are not supported on this platform\n");
-#define LIBUSB_NANO 10839
+#define LIBUSB_NANO 10840