Added proper error handling for too long ints

This commit is contained in:
Andreas Tsouchlos 2022-02-13 21:57:43 +01:00
parent 1338888e0b
commit 4666b4e737

View File

@ -89,7 +89,12 @@ constexpr inline void copy2(char* dst, const char* src) {
template <typename uint_t>
constexpr inline void format_decimal(char* out, uint_t value, int n_digits,
int size) {
if (n_digits > size) return;
if (n_digits > size) {
for (int i = 0; i < size; ++i) {
*(out++) = 'f';
}
return;
}
out += size;
while (value >= 100) {