Skip to content

Commit 1eb9a5c

Browse files
rluboskartben
authored andcommitted
net: mqtt: Fix helper macro for encoded binary data length
The macro did not take into account the 2-byte binary data length encoded before the actual binary data. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
1 parent 08f8e2f commit 1eb9a5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

subsys/net/lib/mqtt/mqtt_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ extern "C" {
7676
#define GET_UT8STR_BUFFER_SIZE(STR) (sizeof(uint16_t) + (STR)->size)
7777

7878
/**@brief Computes total size needed to pack a binary stream. */
79-
#define GET_BINSTR_BUFFER_SIZE(STR) ((STR)->len)
79+
#define GET_BINSTR_BUFFER_SIZE(STR) (sizeof(uint16_t) + (STR)->len)
8080

8181
/**@brief Sets MQTT Client's state with one indicated in 'STATE'. */
8282
#define MQTT_SET_STATE(CLIENT, STATE) ((CLIENT)->internal.state |= (STATE))

0 commit comments

Comments
 (0)