summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Kerola <kerolasa@iki.fi>2018-11-11 17:03:18 +0000
committerSami Kerola <kerolasa@iki.fi>2018-11-11 17:03:18 +0000
commit2175456864bebef4f6a926b63b65ce8e7f2d2f80 (patch)
treef59abd22f650ddef957bc4e8115ac9dd461b8985
parent18c56c24a059cce73cb473ff426454f0d96e1400 (diff)
downloadiputils-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.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ping.c b/ping.c
index 38e1097..17a3162 100644
--- a/ping.c
+++ b/ping.c
@@ -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;
}