From 922339633b08d0815eaf236c94edb774e190ff7f Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Wed, 1 Jul 2009 18:17:16 +0200 Subject: Fix segfault when displaying usage for installed iphoneinfo and iphonesyslog --- dev/iphoneinfo.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'dev/iphoneinfo.c') 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"); -- cgit v1.1-32-gdbae