projects
/
liboping.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a1710d9
)
src/oping.c: Improved and unified error messages when parsing CL options.
author
Sebastian Harl
<sh@tokkee.org>
Sat, 6 Jun 2009 19:09:33 +0000
(21:09 +0200)
committer
Sebastian Harl
<sh@tokkee.org>
Thu, 16 Jul 2009 16:48:38 +0000
(18:48 +0200)
src/oping.c
patch
|
blob
|
history
diff --git
a/src/oping.c
b/src/oping.c
index
c901223
..
06fb801
100644
(file)
--- 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;
new_count = atoi (optarg);
if (new_count > 0)
opt_count = new_count;
+ else
+ fprintf(stderr, "Ignoring invalid count: %s\n",
+ optarg);
}
break;
}
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)
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;
}
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
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, "I
gnoring i
nvalid TTL argument: %s\n",
optarg);
break;
}
optarg);
break;
}