From: Jim Meyering Date: Sun, 24 Mar 1996 18:16:10 +0000 (+0000) Subject: Include xstrtod.h. X-Git-Tag: SH-UTILS-1_12e~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9714aa24d03123aa1ee60435d09a99ece9626e9;p=thirdparty%2Fcoreutils.git Include xstrtod.h. (scan_double_arg): Use xstrtod rather than strtod directly. --- diff --git a/src/seq.c b/src/seq.c index 88abf3cbed..aa78b9f84f 100644 --- a/src/seq.c +++ b/src/seq.c @@ -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 */ }