1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-27 19:10:17 +02:00

numfmt: fix strtol() return code handling

src/numfmt.c (parse_format_string): On some systems, strtol() returns
EINVAL if no conversion was performed.  So only handle ERANGE here,
and handle other format errors directly.
This commit is contained in:
Assaf Gordon
2013-02-12 15:28:22 -05:00
committed by Pádraig Brady
parent 54cdb0e88b
commit fff11aca4f
+1 -1
View File
@@ -970,7 +970,7 @@ parse_format_string (char const *fmt)
i += strspn (fmt + i, " ");
errno = 0;
pad = strtol (fmt + i, &endptr, 10);
if (errno != 0)
if (errno == ERANGE)
error (EXIT_FAILURE, 0,
_("invalid format %s (width overflow)"), quote (fmt));