Skip to content

Commit

Permalink
fix: increase buffer to fit exponents for double values
Browse files Browse the repository at this point in the history
  • Loading branch information
SGSSGene committed Jul 9, 2024
1 parent 980ad60 commit 5378300
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/yaml-cpp/fp_to_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ auto fp_to_string(T v, int precision) -> std::string {
}
}

std::array<char, 26> output_buffer; // max digits of size_t plus sign, a dot and 4 letters for the exponent
std::array<char, 28> output_buffer; // max digits of size_t plus sign, a dot and 2 letters for 'e+' or 'e-' and 4 letters for the exponent
auto output_ptr = &output_buffer[0];

// print '-' symbol for negative numbers
Expand Down

0 comments on commit 5378300

Please sign in to comment.