summaryrefslogtreecommitdiffstats
path: root/net/ping.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ping.c')
-rw-r--r--net/ping.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ping.c b/net/ping.c
index 5909c31fe8..e9336b9578 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -83,12 +83,9 @@ PingHandler (uchar * pkt, unsigned dest, unsigned src, unsigned len)
int do_ping (cmd_tbl_t *cmdtp, int argc, char *argv[])
{
- if (argc < 2)
- return -1;
-
- if (string_to_ip(argv[1], &NetPingIP)) {
+ if (argc < 2 || string_to_ip(argv[1], &NetPingIP)) {
printf ("Usage:\n%s\n", cmdtp->usage);
- return -1;
+ return 1;
}
if (NetLoopInit(PING) < 0)