From 5d55c8e0407c43a4292dd05d0b2b97a8256350b0 Mon Sep 17 00:00:00 2001 From: Bert Melis Date: Fri, 10 Mar 2017 13:04:31 +0100 Subject: [PATCH] Fix truncated IP published IP is truncated. --- src/Homie/Boot/BootNormal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Homie/Boot/BootNormal.cpp b/src/Homie/Boot/BootNormal.cpp index 565a2df4..19c3f070 100644 --- a/src/Homie/Boot/BootNormal.cpp +++ b/src/Homie/Boot/BootNormal.cpp @@ -190,7 +190,7 @@ void BootNormal::_onMqttConnected() { IPAddress localIp = WiFi.localIP(); char localIpStr[MAX_IP_STRING_LENGTH]; - snprintf(localIpStr, MAX_IP_STRING_LENGTH - 1, "%d.%d.%d.%d", localIp[0], localIp[1], localIp[2], localIp[3]); + snprintf(localIpStr, MAX_IP_STRING_LENGTH, "%d.%d.%d.%d", localIp[0], localIp[1], localIp[2], localIp[3]); Interface::get().getMqttClient().publish(_prefixMqttTopic(PSTR("/$localip")), 1, true, localIpStr);