From f83d2a911191934082700b9c64108f116bed0cdf Mon Sep 17 00:00:00 2001 From: Anton Maklakov Date: Thu, 3 Mar 2022 12:43:11 +0700 Subject: [PATCH] remove unused variable --- lib/mqtt_msg.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/mqtt_msg.c b/lib/mqtt_msg.c index 3a8554c..1ccc74f 100644 --- a/lib/mqtt_msg.c +++ b/lib/mqtt_msg.c @@ -198,17 +198,14 @@ bool mqtt_header_complete(uint8_t *buffer, size_t buffer_length) char *mqtt_get_publish_topic(uint8_t *buffer, size_t *length) { int i; - int totlen = 0; int topiclen; for (i = 1; i < *length; ++i) { - totlen += (buffer[i] & 0x7f) << (7 * (i - 1)); if ((buffer[i] & 0x80) == 0) { ++i; break; } } - totlen += i; if (i + 2 >= *length) { return NULL;