diff --git a/src/numfmt.c b/src/numfmt.c index d87d8efce..9a321d697 100644 --- a/src/numfmt.c +++ b/src/numfmt.c @@ -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));