diff options
Diffstat (limited to 'tools/idevicename.c')
| -rw-r--r-- | tools/idevicename.c | 8 |
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) | |||
| 38 | printf("Display the device name or set it to NAME if specified.\n"); | 38 | printf("Display the device name or set it to NAME if specified.\n"); |
| 39 | printf("\n"); | 39 | printf("\n"); |
| 40 | printf(" -d, --debug\t\tenable communication debugging\n"); | 40 | printf(" -d, --debug\t\tenable communication debugging\n"); |
| 41 | printf(" -u, --udid UDID\tuse UDID to target a specific device\n"); | 41 | printf(" -u, --udid UDID\ttarget specific device by UDID\n"); |
| 42 | printf(" -h, --help\t\tprint usage information\n"); | 42 | printf(" -h, --help\t\tprint usage information\n"); |
| 43 | printf("\n"); | 43 | printf("\n"); |
| 44 | printf("Homepage: <" PACKAGE_URL ">\n"); | 44 | printf("Homepage: <" PACKAGE_URL ">\n"); |
| @@ -60,6 +60,12 @@ int main(int argc, char** argv) | |||
| 60 | while ((c = getopt_long(argc, argv, "du:h", longopts, &optidx)) != -1) { | 60 | while ((c = getopt_long(argc, argv, "du:h", longopts, &optidx)) != -1) { |
| 61 | switch (c) { | 61 | switch (c) { |
| 62 | case 'u': | 62 | case 'u': |
| 63 | if (!*optarg) { | ||
| 64 | fprintf(stderr, "ERROR: UDID must not be empty!\n"); | ||
| 65 | print_usage(); | ||
| 66 | exit(2); | ||
| 67 | } | ||
| 68 | free(udid); | ||
| 63 | udid = strdup(optarg); | 69 | udid = strdup(optarg); |
| 64 | break; | 70 | break; |
| 65 | case 'h': | 71 | case 'h': |
