From: Nathael Pajani Date: Sat, 16 Mar 2019 16:30:52 +0000 (+0100) Subject: Change the lenght value, not the address of the pointer to the length value X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=cb9972c1e32b08926734939b0fc9057323ddb782;p=soft%2Flpc122x%2Fcore Change the lenght value, not the address of the pointer to the length value --- diff --git a/lib/protocols/mqtt.c b/lib/protocols/mqtt.c index 6a6cef7..cec954c 100644 --- a/lib/protocols/mqtt.c +++ b/lib/protocols/mqtt.c @@ -78,7 +78,7 @@ static int decode_remaining_length(uint8_t* buf, uint32_t* length) int idx = 0; do { - length += (buf[idx] & 0x7F) << (7 * idx); + *length += (buf[idx] & 0x7F) << (7 * idx); } while ((buf[idx++] & 0x80) && (idx <= 3)); return idx;