Fix compilation error

This commit is contained in:
Theo Arends 2021-06-06 18:05:28 +02:00
parent 749093a697
commit 5175653922
1 changed files with 4 additions and 0 deletions

View File

@ -888,7 +888,11 @@ void HAssAnnounceSensors(void)
TasmotaGlobal.tele_period = tele_period_save;
size_t sensordata_len = ResponseLength();
char sensordata[sensordata_len+2]; // dynamically adjust the size
#ifdef MQTT_DATA_STRING
strcpy(sensordata, TasmotaGlobal.mqtt_data.c_str()); // we can use strcpy since the buffer has the right size
#else
strcpy(sensordata, TasmotaGlobal.mqtt_data); // we can use strcpy since the buffer has the right size
#eindif
// ******************* JSON TEST *******************
// char sensordata[512];