Skip to content

Commit dcd28ab

Browse files
authored
Increase output buffer size for float to string conversion
avoid werror #1428
1 parent 6f3b99c commit dcd28ab

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/fptostring.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ std::string FpToString(T v, int precision = 0) {
131131

132132
// Case 1 - scientific notation: max digits of size_t plus sign, a dot and 2 letters for 'e+' or 'e-' and 4 letters for the exponent
133133
// Case 2 - default notation: require up to precision number of digits and one for a potential sign
134-
std::array<char, 28> output_buffer;
134+
std::array<char, 32> output_buffer;
135135
auto output_ptr = &output_buffer[0];
136136

137137
// Helper variable that in Case 2 counts the overflowing number of zeros that do not fit into the buffer.

0 commit comments

Comments
 (0)