mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03: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:
1 parent
54cdb0e88b
commit
fff11aca4f
1 file changed
+1
-1
+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