summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-10-04 13:31:56 +0100
committerPete Batard <pbatard@gmail.com>2010-10-04 13:31:56 +0100
commitcf1b3cf3e99f6f6b693d1b2284a69253be14bbd4 (patch)
tree8eee2d00a7d6b7dfb165c5305f34921b4248f8b2
parent2590159c404c39eeddbba2b44092916fd5b1c5f6 (diff)
downloadlibusb-cf1b3cf3e99f6f6b693d1b2284a69253be14bbd4.tar.gz
fixed erroneous checks on SetupDi calls
-rw-r--r--libusb/os/windows_usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libusb/os/windows_usb.c b/libusb/os/windows_usb.c
index ec8c593..a18f6fa 100644
--- a/libusb/os/windows_usb.c
+++ b/libusb/os/windows_usb.c
@@ -1459,7 +1459,7 @@ static int set_device_paths(struct libusb_context *ctx, struct discovered_devs *
// Check that the driver installation is OK
if ( (!SetupDiGetDeviceRegistryProperty(dev_info, &dev_info_data, SPDRP_INSTALL_STATE,
&reg_type, (BYTE*)&install_state, 4, &size))
- && (size != 4) ){
+ || (size != 4) ){
usbi_warn(ctx, "could not detect installation state of driver for %s: %s",
dev_interface_details->DevicePath, windows_error_str(0));
} else if (install_state != 0) {
@@ -1471,7 +1471,7 @@ static int set_device_paths(struct libusb_context *ctx, struct discovered_devs *
// The SPDRP_ADDRESS for USB devices should be the device port number on the hub
if ( (!SetupDiGetDeviceRegistryProperty(dev_info, &dev_info_data, SPDRP_ADDRESS,
&reg_type, (BYTE*)&port_nr, 4, &size))
- && (size != 4) ){
+ || (size != 4) ){
usbi_warn(ctx, "could not retrieve port number for device %s, skipping: %s",
dev_interface_details->DevicePath, windows_error_str(0));
continue;