From 2a43004b71219fc30898a632ec49fc2ae0f2c91c Mon Sep 17 00:00:00 2001 From: SH Date: Thu, 26 Nov 2020 08:33:58 +0100 Subject: [PATCH] fix bool leakage --- libraries/SondeLib/Sonde.h | 2 +- libraries/SondeLib/mqtt.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/SondeLib/Sonde.h b/libraries/SondeLib/Sonde.h index 5d7325c..d1d4111 100644 --- a/libraries/SondeLib/Sonde.h +++ b/libraries/SondeLib/Sonde.h @@ -145,7 +145,7 @@ struct st_kisstnc { }; struct st_mqtt { - bool active; + int active; char id[64]; char host[64]; int port; diff --git a/libraries/SondeLib/mqtt.cpp b/libraries/SondeLib/mqtt.cpp index 5704921..c2cabb1 100644 --- a/libraries/SondeLib/mqtt.cpp +++ b/libraries/SondeLib/mqtt.cpp @@ -23,7 +23,7 @@ void MQTT::init(const char* ip, uint16_t port, const char* id, const char *usern this->prefix = prefix; char buffer[20]; - snprintf(buffer, 20, "%s%d", id, random(0, 1000)); + snprintf(buffer, 20, "%s%6ld", id, random(0, 1000)); this->id = buffer; Serial.println("[MQTT] pubsub client");