summaryrefslogtreecommitdiffstats
path: root/dev/syslog_relay.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-07-01 18:17:16 +0200
committerGravatar Martin Szulecki2009-07-01 18:17:16 +0200
commit922339633b08d0815eaf236c94edb774e190ff7f (patch)
tree5667e7389e8f04308b269e925cfab711da4be583 /dev/syslog_relay.c
parentd65b84037d85d107d97b181a815f4ccc5bc4bd54 (diff)
downloadlibimobiledevice-922339633b08d0815eaf236c94edb774e190ff7f.tar.gz
libimobiledevice-922339633b08d0815eaf236c94edb774e190ff7f.tar.bz2
Fix segfault when displaying usage for installed iphoneinfo and iphonesyslog
Diffstat (limited to 'dev/syslog_relay.c')
-rw-r--r--dev/syslog_relay.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/dev/syslog_relay.c b/dev/syslog_relay.c
index e552e9c..6698653 100644
--- a/dev/syslog_relay.c
+++ b/dev/syslog_relay.c
@@ -154,7 +154,10 @@ int main(int argc, char *argv[])
void print_usage(int argc, char **argv)
{
- 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("Relay syslog of a 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");