From: Sebastian Harl Date: Sat, 6 Jun 2009 19:09:33 +0000 (+0200) Subject: src/oping.c: Improved and unified error messages when parsing CL options. X-Git-Tag: liboping-1.3.0~16 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=73a764bcb1c2d802b0a457fa8280edf48e03953a;p=liboping.git src/oping.c: Improved and unified error messages when parsing CL options. --- diff --git a/src/oping.c b/src/oping.c index c901223..06fb801 100644 --- a/src/oping.c +++ b/src/oping.c @@ -146,6 +146,9 @@ static int read_options (int argc, char **argv) new_count = atoi (optarg); if (new_count > 0) opt_count = new_count; + else + fprintf(stderr, "Ignoring invalid count: %s\n", + optarg); } break; @@ -162,8 +165,8 @@ static int read_options (int argc, char **argv) double new_interval; new_interval = atof (optarg); if (new_interval < 0.001) - fprintf (stderr, "Ignoring invalid interval %g.\n", - new_interval); + fprintf (stderr, "Ignoring invalid interval: %s\n", + optarg); else opt_interval = new_interval; } @@ -183,7 +186,7 @@ static int read_options (int argc, char **argv) if ((new_send_ttl > 0) && (new_send_ttl < 256)) opt_send_ttl = new_send_ttl; else - fprintf (stderr, "Invalid TTL argument: %s\n", + fprintf (stderr, "Ignoring invalid TTL argument: %s\n", optarg); break; }