make topic str bigger to allow for homeassistance long packages

This commit is contained in:
proddy
2020-08-07 14:15:13 +02:00
parent 9e286d8c3c
commit f7fe69c2f7

View File

@@ -454,7 +454,7 @@ std::shared_ptr<const MqttMessage> Mqtt::queue_message(const uint8_t operation,
message = std::make_shared<MqttMessage>(operation, topic, std::move(payload), retain); message = std::make_shared<MqttMessage>(operation, topic, std::move(payload), retain);
} else { } else {
// prefix the hostname // prefix the hostname
std::string full_topic(20, '\0'); std::string full_topic(50, '\0');
snprintf_P(&full_topic[0], full_topic.capacity() + 1, PSTR("%s/%s"), Mqtt::hostname_.c_str(), topic.c_str()); snprintf_P(&full_topic[0], full_topic.capacity() + 1, PSTR("%s/%s"), Mqtt::hostname_.c_str(), topic.c_str());
message = std::make_shared<MqttMessage>(operation, full_topic, std::move(payload), retain); message = std::make_shared<MqttMessage>(operation, full_topic, std::move(payload), retain);
} }