diff options
author | Jim Meyering <jim@meyering.net> | 1996-03-24 18:16:10 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-03-24 18:16:10 +0000 |
commit | f9714aa24d03123aa1ee60435d09a99ece9626e9 (patch) | |
tree | c8067d845836e31755d2f35d933085d23e82872f /src | |
parent | a9ff449aa6e34daa40b8d9e9df7506fa86d3ea3e (diff) | |
download | coreutils-f9714aa24d03123aa1ee60435d09a99ece9626e9.tar.xz |
Include xstrtod.h.
(scan_double_arg): Use xstrtod rather than strtod directly.
Diffstat (limited to 'src')
-rw-r--r-- | src/seq.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -24,6 +24,7 @@ #include "system.h" #include "error.h" +#include "xstrtod.h" static double scan_double_arg __P ((const char *arg)); static int check_format __P ((const char *format_string)); @@ -232,14 +233,11 @@ format string may not be specified when printing equal width strings")); static double scan_double_arg (const char *arg) { - char *end_ptr; double ret_val; - /* FIXME: use xstrtod? At least set and check errno. */ - ret_val = strtod (arg, &end_ptr); - if (end_ptr == arg || *end_ptr != '\0') + if (xstrtod (arg, NULL, &ret_val)) { - error (0, 0, _("invalid float argument: %s"), arg); + error (0, 0, _("invalid floating point argument: %s"), arg); usage (1); /* NOTREACHED */ } |