diff options
author | Sami Kerola <kerolasa@iki.fi> | 2018-11-11 17:03:18 +0000 |
---|---|---|
committer | Sami Kerola <kerolasa@iki.fi> | 2018-11-11 17:03:18 +0000 |
commit | 2175456864bebef4f6a926b63b65ce8e7f2d2f80 (patch) | |
tree | f59abd22f650ddef957bc4e8115ac9dd461b8985 | |
parent | 18c56c24a059cce73cb473ff426454f0d96e1400 (diff) | |
download | iputils-2175456864bebef4f6a926b63b65ce8e7f2d2f80.tar.gz |
ping: make ping_strtod() fail path more obvious
The error() function will print wanted message regardless what is the errno
value, including zero.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r-- | ping.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -211,9 +211,8 @@ static double ping_strtod(const char *str, const char *err_msg) } return num; err: - if (errno == ERANGE) - error(2, errno, "%s: %s", err_msg, str); - error(2, 0, "%s: %s", err_msg, str); + error(2, errno, "%s: %s", err_msg, str); + abort(); /* cannot be reached, above error() will exit */ return 0.0; } |