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:
committed by
Pádraig Brady
parent
54cdb0e88b
commit
fff11aca4f
+1
-1
@@ -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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user