1
0
mirror of https://github.com/esphome/esphome.git synced 2026-02-08 08:41:59 +00:00

Merge branch 'wifi_info_less_alloc' into integration

This commit is contained in:
J. Nick Koston
2025-12-25 16:03:31 -10:00

View File

@@ -698,8 +698,11 @@ inline char *int8_to_str(char *buf, int8_t val) {
if (v >= 100) {
*buf++ = '1'; // int8 max is 128, so hundreds digit is always 1
v -= 100;
}
if (v >= 10) {
// Must write tens digit (even if 0) after hundreds
int tens = v / 10;
*buf++ = '0' + tens;
v -= tens * 10;
} else if (v >= 10) {
int tens = v / 10;
*buf++ = '0' + tens;
v -= tens * 10;