diff options
author | Nikias Bassen | 2018-09-03 13:55:59 +0200 |
---|---|---|
committer | Nikias Bassen | 2018-09-03 13:55:59 +0200 |
commit | f1d7ac2ba8f598fce0135af4894b2f7cf3c03a9d (patch) | |
tree | 9cfa8245f0fc7130e7b6533ab92c5c65d23c66f5 | |
parent | 27b13f782720199420f7dc07993deed1958a0dbf (diff) | |
download | libirecovery-f1d7ac2ba8f598fce0135af4894b2f7cf3c03a9d.tar.gz libirecovery-f1d7ac2ba8f598fce0135af4894b2f7cf3c03a9d.tar.bz2 |
win32: Fix parsing of usb device path since it changed with newer drivers
-rw-r--r-- | src/libirecovery.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libirecovery.c b/src/libirecovery.c index 4084205..5fc07ba 100644 --- a/src/libirecovery.c +++ b/src/libirecovery.c @@ -569,13 +569,14 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec } char serial_str[256]; + char *p = strrchr(result, '\\'); serial_str[0] = '\0'; - if ((sscanf(result, "\\\\?\\usb#vid_%*04x&pid_%*04x#%s#", serial_str) != 1) || (serial_str[0] == '\0')) { + if (!p && (sscanf(p, "\\usb#vid_%*04x&pid_%*04x#%s", serial_str) != 1) || (serial_str[0] == '\0')) { mobiledevice_closepipes(_client); continue; } - char* p = strchr(serial_str, '#'); + p = strchr(serial_str, '#'); if (p) { *p = '\0'; } @@ -645,13 +646,14 @@ irecv_error_t mobiledevice_connect(irecv_client_t* client, unsigned long long ec } char serial_str[256]; + char *p = strrchr(result, '\\'); serial_str[0] = '\0'; - if ((sscanf(result, "\\\\?\\usb#vid_%*04x&pid_%*04x#%s#", serial_str) != 1) || (serial_str[0] == '\0')) { + if (!p || (sscanf(p, "\\usb#vid_%*04x&pid_%*04x#%s", serial_str) != 1) || (serial_str[0] == '\0')) { mobiledevice_closepipes(_client); continue; } - char* p = strchr(serial_str, '#'); + p = strchr(serial_str, '#'); if (p) { *p = '\0'; } |