diff options
author | Nikias Bassen | 2018-10-12 14:39:14 +0200 |
---|---|---|
committer | Nikias Bassen | 2018-10-12 14:39:14 +0200 |
commit | 4f08767fa302bfdd2740ce69398266309aaa8cfb (patch) | |
tree | 2b48c809a84f7bf4eca5d8ef6a8bc531afc6fd50 | |
parent | f4d36e36cf6a32b1fbd62e57d55c0b4c67c387d0 (diff) | |
download | libusbmuxd-4f08767fa302bfdd2740ce69398266309aaa8cfb.tar.gz libusbmuxd-4f08767fa302bfdd2740ce69398266309aaa8cfb.tar.bz2 |
Add hyphen to new style UDIDs on device add events too
-rw-r--r-- | src/libusbmuxd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c index a183919..39db216 100644 --- a/src/libusbmuxd.c +++ b/src/libusbmuxd.c @@ -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); } |