diff --git a/include/fmt/format.h b/include/fmt/format.h index 4093e37d..ad04bc41 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2167,8 +2167,8 @@ auto write_int(OutputIt out, UInt value, unsigned prefix, throw_format_error("invalid format specifier"); } - unsigned size = to_unsigned((prefix != 0 ? prefix >> 24 : 0) + num_digits + - grouping.count_separators(num_digits)); + unsigned size = (prefix != 0 ? prefix >> 24 : 0) + to_unsigned(num_digits) + + to_unsigned(grouping.count_separators(num_digits)); return write_padded( out, specs, size, size, [&](reserve_iterator it) { for (unsigned p = prefix & 0xffffff; p != 0; p >>= 8)