Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
winusb: Fix winusb_get_device_list() failing to find port numbers
Fix recent regression introduced in commit 9d595d4. get_dev_port_number() was always returning port number 0 for any port, due to the incorrect assumption that strtoll's 'end' pointer will point to a null terminator on success. This was causing winusb_get_device_list() to always fail. Since we actually know the expected values of *end for both the SPDRP_LOCATION_INFORMATION and the SPDRP_LOCATION_PATHS case, check for those instead. Additionally, document why a return value of 0 is treated as a failure in this particular function, for valid but somewhat coincidental reasons that may not be immediately obvious. Closes libusb#1544
- Loading branch information