summaryrefslogtreecommitdiffstats
path: root/dev/iphoneinfo.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-07-01 18:17:16 +0200
committerGravatar Matt Colyer2009-07-01 19:42:53 -0700
commitade4dedb5f0d69122a5c742aa96c8bd150dab9a7 (patch)
treefe546fac54da415fe374155ae3962990c51da7fe /dev/iphoneinfo.c
parentf035afebdb932a0f32c6a394f72e23418c52302f (diff)
downloadlibimobiledevice-ade4dedb5f0d69122a5c742aa96c8bd150dab9a7.tar.gz
libimobiledevice-ade4dedb5f0d69122a5c742aa96c8bd150dab9a7.tar.bz2
Fix segfault when displaying usage for installed iphoneinfo and iphonesyslog
[#54 state:resolved] Signed-off-by: Matt Colyer <matt@colyer.name>
Diffstat (limited to 'dev/iphoneinfo.c')
-rw-r--r--dev/iphoneinfo.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dev/iphoneinfo.c b/dev/iphoneinfo.c
index 641b47d..18ee055 100644
--- a/dev/iphoneinfo.c
+++ b/dev/iphoneinfo.c
@@ -158,7 +158,10 @@ int is_domain_known(char *domain)
void print_usage(int argc, char **argv)
{
int i = 0;
- printf("Usage: %s [OPTIONS]\n", (strrchr(argv[0], '/') + 1));
+ char *name = NULL;
+
+ name = strrchr(argv[0], '/');
+ printf("Usage: %s [OPTIONS]\n", (name ? name + 1: argv[0]));
printf("Show information about the first connected iPhone/iPod Touch.\n\n");
printf(" -d, --debug\t\tenable communication debugging\n");
printf(" -u, --uuid UUID\ttarget specific device by its 40-digit device UUID\n");