From 73a764bcb1c2d802b0a457fa8280edf48e03953a Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sat, 6 Jun 2009 21:09:33 +0200 Subject: [PATCH] src/oping.c: Improved and unified error messages when parsing CL options. --- src/oping.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; } -- 2.30.2