fix mqtt errors

This commit is contained in:
gemu2015 2021-07-01 08:27:47 +02:00
parent 0052a49824
commit e0e49df57c
2 changed files with 4 additions and 4 deletions

View File

@ -2402,9 +2402,9 @@ chknext:
rstring[0] = 0;
int8_t index = fvar;
#ifdef MQTT_DATA_STRING
char *wd = TasmotaGlobal.mqtt_data;
char *wd = (char*)TasmotaGlobal.mqtt_data.c_str();
#else
char *wd = TasmotaGlobal.mqtt_data.c_str();
char *wd = TasmotaGlobal.mqtt_data;
#endif
strlcpy(rstring, wd, glob_script_mem.max_ssize);
if (index) {

View File

@ -1302,7 +1302,7 @@ void DisplayDTVarsTeleperiod(void) {
char *json = (char*)malloc(jlen + 2);
if (json) {
#ifdef MQTT_DATA_STRING
strlcpy(json, TasmotaGlobal.mqtt_data.c_str(), jlen + 1);
strlcpy(json, (char*)TasmotaGlobal.mqtt_data.c_str(), jlen + 1);
#else
strlcpy(json, TasmotaGlobal.mqtt_data, jlen + 1);
#endif
@ -1325,7 +1325,7 @@ void get_dt_mqtt(void) {
ResponseJsonEnd();
}
#ifdef MQTT_DATA_STRING
get_dt_vars(TasmotaGlobal.mqtt_data.c_str());
get_dt_vars((char*)TasmotaGlobal.mqtt_data.c_str());
#else
get_dt_vars(TasmotaGlobal.mqtt_data);
#endif