Skip to content

Commit

Permalink
Add hyphen to new style UDIDs on device add events too
Browse files Browse the repository at this point in the history
  • Loading branch information
nikias committed Oct 12, 2018
1 parent f4d36e3 commit 4f08767
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libusbmuxd.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,11 @@ static int get_next_event(int sfd, usbmuxd_event_cb_t callback, void *user_data)
memset(devinfo->udid, '\0', sizeof(devinfo->udid));
memcpy(devinfo->udid, dev->serial_number, sizeof(devinfo->udid));

if (strlen(devinfo->udid) == 24) {
memmove(&devinfo->udid[9], &devinfo->udid[8], 17);
devinfo->udid[8] = '-';
}

if (strcasecmp(devinfo->udid, "ffffffffffffffffffffffffffffffffffffffff") == 0) {
sprintf(devinfo->udid + 32, "%08x", devinfo->handle);
}
Expand Down

0 comments on commit 4f08767

Please sign in to comment.