From 7d1a27560606fc0a0a83d0a0292d44d095d4b455 Mon Sep 17 00:00:00 2001 From: gemu2015 Date: Mon, 15 Jun 2020 07:25:39 +0200 Subject: [PATCH] fix chartofloat digit overflow --- tasmota/support.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasmota/support.ino b/tasmota/support.ino index 879a91fb0..0a5d26f10 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -167,6 +167,8 @@ float CharToFloat(const char *str) float right = 0; if (*pt == '.') { pt++; + // limit decimals to float max + pt[7]=0; right = atoi(pt); // Decimal part while (isdigit(*pt)) { pt++; @@ -1908,4 +1910,4 @@ String Decompress(const char * compressed, size_t uncompressed_size) { return content; } -#endif // USE_UNISHOX_COMPRESSION \ No newline at end of file +#endif // USE_UNISHOX_COMPRESSION