From 41d97e1ef4a451da741ac64bf6d1010f8568ea22 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sun, 11 Oct 2020 06:47:51 -0700 Subject: [PATCH] Fix a UB on ridiculously large precision --- include/fmt/format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 83c7c54f..eb9e216a 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1804,7 +1804,7 @@ OutputIt write_float(OutputIt out, const DecimalFP& fp, int significand_size = get_significand_size(fp); static const Char zero = static_cast('0'); auto sign = fspecs.sign; - int size = significand_size + (sign ? 1 : 0); + long long size = significand_size + (sign ? 1 : 0); using iterator = remove_reference_t; int output_exp = fp.exponent + significand_size - 1;