diff --git a/src/PubSubClient.cpp b/src/PubSubClient.cpp index 9658c4a..5932bdb 100755 --- a/src/PubSubClient.cpp +++ b/src/PubSubClient.cpp @@ -306,12 +306,10 @@ boolean PubSubClient::loop() { uint8_t type = buffer[0]&0xF0; if (type == MQTTPUBLISH) { if (callback) { - uint16_t tl = (buffer[llen+1]<<8)+buffer[llen+2]; - char topic[tl+1]; - for (uint16_t i=0;i0 if ((buffer[0]&0x06) == MQTTQOS1) { msgId = (buffer[llen+3+tl]<<8)+buffer[llen+3+tl+1];