From 2db717406894c478fb634cccda7445ad6ab885e3 Mon Sep 17 00:00:00 2001 From: MichaelDvP <59284019+MichaelDvP@users.noreply.github.com> Date: Mon, 10 Jul 2023 07:57:24 +0200 Subject: [PATCH] fix cutting output of large numbers #1213 --- src/helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.cpp b/src/helpers.cpp index 692c82513..e6de1c060 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -277,7 +277,7 @@ char * Helpers::render_value(char * result, const double value, const int8_t for // format: 0=no division, other divide by the value given and render with a decimal point char * Helpers::render_value(char * result, const int32_t value, const int8_t format, const uint8_t fahrenheit) { int32_t new_value = fahrenheit ? format ? value * 1.8 + 32 * format * (fahrenheit - 1) : value * 1.8 + 32 * (fahrenheit - 1) : value; - char s[10] = {0}; + char s[13] = {0}; // just print it if no conversion required (format = 0) if (!format) { strlcpy(result, itoa(new_value, s, 10), sizeof(s)); // format is 0