Fix for empty intopic?

https://github.com/toblum/McLighting/issues/52
This commit is contained in:
Tobias Blum
2017-11-05 01:12:51 +01:00
parent a025e0a35a
commit e79524ed8e
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -300,8 +300,8 @@ void setup() {
// ***************************************************************************
#ifdef ENABLE_MQTT
if (mqtt_host != "" && String(mqtt_port).toInt() > 0) {
String(String(HOSTNAME) + "/in").toCharArray(mqtt_intopic, strlen(HOSTNAME) + 4);
String(String(HOSTNAME) + "/out").toCharArray(mqtt_outtopic, strlen(HOSTNAME) + 5);
snprintf(mqtt_intopic, sizeof mqtt_intopic, "%s/in", HOSTNAME);
snprintf(mqtt_outtopic, sizeof mqtt_outtopic, "%s/out", HOSTNAME);
DBG_OUTPUT_PORT.printf("MQTT active: %s:%d\n", mqtt_host, String(mqtt_port).toInt());