summaryrefslogtreecommitdiffstats
path: root/tools/idevice_id.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevice_id.c')
-rw-r--r--tools/idevice_id.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/idevice_id.c b/tools/idevice_id.c
index 6f020ff..558dcbe 100644
--- a/tools/idevice_id.c
+++ b/tools/idevice_id.c
@@ -40,7 +40,7 @@ static void print_usage(int argc, char **argv)
40 name = strrchr(argv[0], '/'); 40 name = strrchr(argv[0], '/');
41 printf("Usage: %s [OPTIONS] [UDID]\n", (name ? name + 1: argv[0])); 41 printf("Usage: %s [OPTIONS] [UDID]\n", (name ? name + 1: argv[0]));
42 printf("Prints device name or a list of attached devices.\n\n"); 42 printf("Prints device name or a list of attached devices.\n\n");
43 printf(" The UDID is a 40-digit hexadecimal number of the device\n"); 43 printf(" UDID is the unique device identifier of the device\n");
44 printf(" for which the name should be retrieved.\n\n"); 44 printf(" for which the name should be retrieved.\n\n");
45 printf(" -l, --list\t\tlist UDID of all attached devices\n"); 45 printf(" -l, --list\t\tlist UDID of all attached devices\n");
46 printf(" -d, --debug\t\tenable communication debugging\n"); 46 printf(" -d, --debug\t\tenable communication debugging\n");
@@ -79,7 +79,7 @@ int main(int argc, char **argv)
79 /* check if udid was passed */ 79 /* check if udid was passed */
80 if (mode == MODE_SHOW_ID) { 80 if (mode == MODE_SHOW_ID) {
81 i--; 81 i--;
82 if (!argv[i] || (strlen(argv[i]) != 40)) { 82 if (argc < 2 || !argv[i] || !*argv[i]) {
83 print_usage(argc, argv); 83 print_usage(argc, argv);
84 return 0; 84 return 0;
85 } 85 }
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
90 case MODE_SHOW_ID: 90 case MODE_SHOW_ID:
91 idevice_new(&device, udid); 91 idevice_new(&device, udid);
92 if (!device) { 92 if (!device) {
93 fprintf(stderr, "ERROR: No device with UDID=%s attached.\n", udid); 93 fprintf(stderr, "ERROR: No device with UDID %s attached.\n", udid);
94 return -2; 94 return -2;
95 } 95 }
96 96