diff --git a/include/fmt/printf.h b/include/fmt/printf.h index 4f0fe9aeca2c..c060952d9e8b 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -60,7 +60,7 @@ namespace detail { // signed and unsigned integers. template struct int_checker { template static auto fits_in_int(T value) -> bool { - unsigned max = max_value(); + unsigned max = to_unsigned(max_value()); return value <= max; } static auto fits_in_int(bool) -> bool { return true; } @@ -205,7 +205,7 @@ class printf_width_handler { specs_.align = align::left; width = 0 - width; } - unsigned int_max = max_value(); + unsigned int_max = to_unsigned(max_value()); if (width > int_max) report_error("number is too big"); return static_cast(width); }