WinCE: Fixed incorrect check of return value, found by cppcheck
authorSean McBride <sean@rogue-research.com>
Thu, 28 Dec 2017 04:55:34 +0000 (23:55 -0500)
committerChris Dickens <christopher.a.dickens@gmail.com>
Fri, 29 Dec 2017 06:40:30 +0000 (22:40 -0800)
cppcheck was warning:

nullPointerRedundantCheck,libusb/os/wince_usb.c:280,warning,Either the condition '!discdevs' is redundant or there is possible null pointer dereference: discdevs.

In fact, the issue was just checking the wrong thing.

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/wince_usb.c
libusb/version_nano.h

index b08403f..003c7a7 100644 (file)
@@ -329,7 +329,7 @@ static int wince_get_device_list(
                }
 
                new_devices = discovered_devs_append(new_devices, dev);
-               if (!discdevs) {
+               if (!new_devices) {
                        r = LIBUSB_ERROR_NO_MEM;
                        goto err_out;
                }
index 55188bd..b17a0ea 100644 (file)
@@ -1 +1 @@
-#define LIBUSB_NANO 11239
+#define LIBUSB_NANO 11240