Fix varint reading.
This commit is contained in:
parent
6c9e8d51c2
commit
17b3709790
@ -291,7 +291,7 @@ int packet__read_varint(struct mosquitto__packet *packet, uint32_t *word)
|
||||
for(i=0; i<4; i++){
|
||||
if(packet->pos < packet->remaining_length){
|
||||
byte = packet->payload[packet->pos];
|
||||
word += (byte & 127) * remaining_mult;
|
||||
*word += (byte & 127) * remaining_mult;
|
||||
remaining_mult *= 128;
|
||||
packet->pos++;
|
||||
if((byte & 128) == 0){
|
||||
|
Loading…
Reference in New Issue
Block a user