summaryrefslogtreecommitdiffstats
path: root/tools/idevicescreenshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicescreenshot.c')
-rw-r--r--tools/idevicescreenshot.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/idevicescreenshot.c b/tools/idevicescreenshot.c
index 766c7ac..cba62a2 100644
--- a/tools/idevicescreenshot.c
+++ b/tools/idevicescreenshot.c
@@ -39,7 +39,7 @@ int main(int argc, char **argv)
uint16_t port = 0;
int result = -1;
int i;
- char *udid = NULL;
+ const char *udid = NULL;
/* parse cmdline args */
for (i = 1; i < argc; i++) {
@@ -53,7 +53,7 @@ int main(int argc, char **argv)
print_usage(argc, argv);
return 0;
}
- udid = strdup(argv[i]);
+ udid = argv[i];
continue;
}
else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
@@ -67,15 +67,13 @@ int main(int argc, char **argv)
}
if (IDEVICE_E_SUCCESS != idevice_new(&device, udid)) {
- printf("No device found, is it plugged in?\n");
if (udid) {
- free(udid);
+ printf("No device found with udid %s, is it plugged in?\n", udid);
+ } else {
+ printf("No device found, is it plugged in?\n");
}
return -1;
}
- if (udid) {
- free(udid);
- }
if (LOCKDOWN_E_SUCCESS != lockdownd_client_new_with_handshake(device, &lckd, NULL)) {
idevice_free(device);