From 6c837872102a400c84c017eb4ef30f0305c9f1cb Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Sun, 19 Jan 2020 12:22:40 +0100 Subject: [PATCH] Lower mqttlog stack usage --- tasmota/xdrv_02_mqtt.ino | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasmota/xdrv_02_mqtt.ino b/tasmota/xdrv_02_mqtt.ino index a5d90f49a..49d1bf259 100644 --- a/tasmota/xdrv_02_mqtt.ino +++ b/tasmota/xdrv_02_mqtt.ino @@ -297,12 +297,11 @@ void MqttUnsubscribe(const char *topic) void MqttPublishLogging(const char *mxtime) { if (MqttIsConnected()) { - char saved_mqtt_data[MESSZ]; + char saved_mqtt_data[strlen(mqtt_data) +1]; memcpy(saved_mqtt_data, mqtt_data, sizeof(saved_mqtt_data)); // ResponseTime_P(PSTR(",\"Log\":{\"%s\"}}"), log_data); // Will fail as some messages contain JSON Response_P(PSTR("%s%s"), mxtime, log_data); // No JSON and ugly!! - char stopic[TOPSZ]; GetTopic_P(stopic, STAT, mqtt_topic, PSTR("LOGGING")); MqttPublishLib(stopic, false);