summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6e31aa1)
Initialize the variable as suggested by http://libusb.sourceforge.net/api-1.0/caveats.html
- int current_configuration = 0;
+ int current_configuration = -1;
libusb_get_configuration(dev, ¤t_configuration);
if (current_configuration != 1)
libusb_set_configuration(dev, 1);
libusb_claim_interface(dev, 0);
libusb_get_configuration(dev, ¤t_configuration);
if (current_configuration != 1)
libusb_set_configuration(dev, 1);
libusb_claim_interface(dev, 0);
+ current_configuration = -1;
libusb_get_configuration(dev, ¤t_configuration);
if (current_configuration != 1) {
res = -ENODEV;
libusb_get_configuration(dev, ¤t_configuration);
if (current_configuration != 1) {
res = -ENODEV;