diff options
Diffstat (limited to 'ping.c')
-rw-r--r-- | ping.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -1,6 +1,6 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * $Id: ping.c,v 1.11 2000/02/08 19:58:47 erik Exp $ | 3 | * $Id: ping.c,v 1.12 2000/04/13 18:49:43 erik Exp $ |
4 | * Mini ping implementation for busybox | 4 | * Mini ping implementation for busybox |
5 | * | 5 | * |
6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> | 6 | * Copyright (C) 1999 by Randolph Chung <tausq@debian.org> |
@@ -182,9 +182,9 @@ extern int ping_main(int argc, char **argv) | |||
182 | static const char *ping_usage = "ping [OPTION]... host\n\n" | 182 | static const char *ping_usage = "ping [OPTION]... host\n\n" |
183 | "Send ICMP ECHO_REQUEST packets to network hosts.\n\n" | 183 | "Send ICMP ECHO_REQUEST packets to network hosts.\n\n" |
184 | "Options:\n" | 184 | "Options:\n" |
185 | "\t-q\t\tQuiet mode, only displays output at start" | 185 | "\t-c COUNT\tSend only COUNT pings.\n" |
186 | 186 | "\t-q\t\tQuiet mode, only displays output at start\n" | |
187 | "\t\t\tand when finished.\n" "\t-c COUNT\tSend only COUNT pings.\n"; | 187 | "\t\t\tand when finished.\n"; |
188 | 188 | ||
189 | static char *hostname = NULL; | 189 | static char *hostname = NULL; |
190 | static struct sockaddr_in pingaddr; | 190 | static struct sockaddr_in pingaddr; |
@@ -418,9 +418,7 @@ extern int ping_main(int argc, char **argv) | |||
418 | argv++; | 418 | argv++; |
419 | options = 0; | 419 | options = 0; |
420 | /* Parse any options */ | 420 | /* Parse any options */ |
421 | while (argc > 1) { | 421 | while (argc >= 1 && **argv == '-') { |
422 | if (**argv != '-') | ||
423 | usage(ping_usage); | ||
424 | thisarg = *argv; | 422 | thisarg = *argv; |
425 | thisarg++; | 423 | thisarg++; |
426 | switch (*thisarg) { | 424 | switch (*thisarg) { |