diff --git a/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino b/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino index b3af31b20..ed6724485 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_39_thermostat.ino @@ -1400,7 +1400,7 @@ void ThermostatGetLocalSensor(uint8_t ctr_output) { &&(ctr_output < THERMOSTAT_SENSOR_NUMBER)) { char temp[4]; temp[0] = IndexSeparator(); - snprintf(&temp[1], 4, "%u", (ctr_output + 1)); + snprintf(&temp[1], sizeof(temp)-1, "%u", (ctr_output + 1)); sensor_name.concat(temp); } JsonParserToken value_token = root[sensor_name].getObject()[PSTR("Temperature")];