From baad92dd0c86b22b758f9d279267e037cfe06f4a Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Sat, 9 May 2020 23:20:44 +0100 Subject: [PATCH] Fix merge error with strnlen --- src/PubSubClient.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/PubSubClient.cpp b/src/PubSubClient.cpp index 14d661e..cda2cde 100755 --- a/src/PubSubClient.cpp +++ b/src/PubSubClient.cpp @@ -132,7 +132,7 @@ boolean PubSubClient::connect(const char *id, const char *user, const char *pass result = _client->connect(this->ip, this->port); } } - + if (result == 1) { nextMsgId = 1; // Leave room in the buffer for header and variable length field @@ -375,11 +375,11 @@ boolean PubSubClient::loop() { } boolean PubSubClient::publish(const char* topic, const char* payload) { - return publish(topic,(const uint8_t*)payload, payload ? strnlen(payload, MQTT_MAX_PACKET_SIZE)) : 0,false); + return publish(topic,(const uint8_t*)payload, payload ? strnlen(payload, MQTT_MAX_PACKET_SIZE) : 0,false); } boolean PubSubClient::publish(const char* topic, const char* payload, boolean retained) { - return publish(topic,(const uint8_t*)payload, payload ? strnlen(payload, MQTT_MAX_PACKET_SIZE)) : 0,retained); + return publish(topic,(const uint8_t*)payload, payload ? strnlen(payload, MQTT_MAX_PACKET_SIZE) : 0,retained); } boolean PubSubClient::publish(const char* topic, const uint8_t* payload, unsigned int plength) { @@ -402,7 +402,7 @@ boolean PubSubClient::publish(const char* topic, const uint8_t* payload, unsigne buffer[length++] = payload[i]; } - // Write the header + // Write the header uint8_t header = MQTTPUBLISH; if (retained) { header |= 1;