diff --git a/include/fmt/core.h b/include/fmt/core.h index fd0782d3..d66c7782 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -2119,9 +2119,10 @@ FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end, if (num_digits == std::numeric_limits::digits10 + 1 && prev * 10ull + unsigned(p[-1] - '0') <= big) { return static_cast(value); + } else { + eh.on_error("number is too big"); + return -1; } - eh.on_error("number is too big"); - return -1; } // Parses fill and alignment.