diff options
author | Nikias Bassen | 2018-10-01 02:32:51 +0200 |
---|---|---|
committer | Nikias Bassen | 2018-10-01 02:32:51 +0200 |
commit | b34e3435c21d06b3e5a4e7b5246fb6ddb6641a9f (patch) | |
tree | 89b78560cd956b956a03c9b207816d8cb345c37e /tools/idevicepair.c | |
parent | f1ee0fd8b2b1dd65c64f5a67e208efc708295caa (diff) | |
download | libimobiledevice-b34e3435c21d06b3e5a4e7b5246fb6ddb6641a9f.tar.gz libimobiledevice-b34e3435c21d06b3e5a4e7b5246fb6ddb6641a9f.tar.bz2 |
tools: Remove length check on device UDID arguments to support newer devices
The 40 characters length check on the device UDID made newer devices unusable
with the libimobiledevice tools and was actually redundant since an invalid
UDID will always fail to resolve. This commit removes the length check
alltogether (but makes sure it is not an empty string "").
Diffstat (limited to 'tools/idevicepair.c')
-rw-r--r-- | tools/idevicepair.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/idevicepair.c b/tools/idevicepair.c index b6f0751..6ae9103 100644 --- a/tools/idevicepair.c +++ b/tools/idevicepair.c @@ -72,7 +72,7 @@ static void print_usage(int argc, char **argv) printf(" list list devices paired with this host\n\n"); printf(" The following OPTIONS are accepted:\n"); printf(" -d, --debug enable communication debugging\n"); - printf(" -u, --udid UDID target specific device by its 40-digit device UDID\n"); + printf(" -u, --udid UDID target specific device by UDID\n"); printf(" -h, --help prints usage information\n"); printf("\n"); printf("Homepage: <" PACKAGE_URL ">\n"); @@ -81,9 +81,9 @@ static void print_usage(int argc, char **argv) static void parse_opts(int argc, char **argv) { static struct option longopts[] = { - {"help", 0, NULL, 'h'}, - {"udid", 1, NULL, 'u'}, - {"debug", 0, NULL, 'd'}, + {"help", no_argument, NULL, 'h'}, + {"udid", required_argument, NULL, 'u'}, + {"debug", no_argument, NULL, 'd'}, {NULL, 0, NULL, 0} }; int c; @@ -99,8 +99,8 @@ static void parse_opts(int argc, char **argv) print_usage(argc, argv); exit(EXIT_SUCCESS); case 'u': - if (strlen(optarg) != 40) { - printf("%s: invalid UDID specified (length != 40)\n", argv[0]); + if (!*optarg) { + fprintf(stderr, "ERROR: UDID must not be empty!\n"); print_usage(argc, argv); exit(2); } |