summaryrefslogtreecommitdiffstats
path: root/tools/idevicename.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicename.c')
-rw-r--r--tools/idevicename.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/idevicename.c b/tools/idevicename.c
index 013becc..ef226f7 100644
--- a/tools/idevicename.c
+++ b/tools/idevicename.c
@@ -38,7 +38,7 @@ static void print_usage(void)
printf("Display the device name or set it to NAME if specified.\n");
printf("\n");
printf(" -d, --debug\t\tenable communication debugging\n");
- printf(" -u, --udid UDID\tuse UDID to target a specific device\n");
+ printf(" -u, --udid UDID\ttarget specific device by UDID\n");
printf(" -h, --help\t\tprint usage information\n");
printf("\n");
printf("Homepage: <" PACKAGE_URL ">\n");
@@ -60,6 +60,12 @@ int main(int argc, char** argv)
while ((c = getopt_long(argc, argv, "du:h", longopts, &optidx)) != -1) {
switch (c) {
case 'u':
+ if (!*optarg) {
+ fprintf(stderr, "ERROR: UDID must not be empty!\n");
+ print_usage();
+ exit(2);
+ }
+ free(udid);
udid = strdup(optarg);
break;
case 'h':