diff --git a/src/numfmt.c b/src/numfmt.c index 305a88603..c56641cfd 100644 --- a/src/numfmt.c +++ b/src/numfmt.c @@ -1081,7 +1081,7 @@ parse_format_string (char const *fmt) errno = 0; pad = strtol (fmt + i, &endptr, 10); - if (errno == ERANGE) + if (errno == ERANGE || pad < -LONG_MAX) die (EXIT_FAILURE, 0, _("invalid format %s (width overflow)"), quote (fmt));