summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/usb.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/usb.c b/src/usb.c
index 0977c24..44c33ce 100644
--- a/src/usb.c
+++ b/src/usb.c
@@ -277,12 +277,19 @@ static void get_serial_callback(struct libusb_transfer *transfer)
else
usbdev->serial[di++] = data[si];
}
- usbdev->serial[di] = 0;
+ usbdev->serial[di] = '\0';
usbmuxd_log(LL_INFO, "Got serial '%s' for device %d-%d", usbdev->serial, usbdev->bus, usbdev->address);
libusb_free_transfer(transfer);
+ /* new style UDID: add hyphen between first 8 and following 16 digits */
+ if (di == 24) {
+ memmove(&usbdev->serial[9], &usbdev->serial[8], 16);
+ usbdev->serial[8] = '-';
+ usbdev->serial[di+1] = '\0';
+ }
+
/* Finish setup now */
if(device_add(usbdev) < 0) {
usb_disconnect(usbdev);