mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-25 11:46:31 +00:00
Merge pull request #8696 from gemu2015/chartofloat_limit
fix chartofloat digit overflow
This commit is contained in:
commit
82b4029eb2
@ -167,6 +167,8 @@ float CharToFloat(const char *str)
|
|||||||
float right = 0;
|
float right = 0;
|
||||||
if (*pt == '.') {
|
if (*pt == '.') {
|
||||||
pt++;
|
pt++;
|
||||||
|
// limit decimals to float max
|
||||||
|
pt[7]=0;
|
||||||
right = atoi(pt); // Decimal part
|
right = atoi(pt); // Decimal part
|
||||||
while (isdigit(*pt)) {
|
while (isdigit(*pt)) {
|
||||||
pt++;
|
pt++;
|
||||||
@ -1908,4 +1910,4 @@ String Decompress(const char * compressed, size_t uncompressed_size) {
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_UNISHOX_COMPRESSION
|
#endif // USE_UNISHOX_COMPRESSION
|
||||||
|
Loading…
x
Reference in New Issue
Block a user