mirror of
https://github.com/shadps4-emu/ext-libusb.git
synced 2026-01-31 00:55:21 +01:00
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 #1544