Fix varint reading.

This commit is contained in:
Roger A. Light 2018-10-02 14:07:23 +01:00
parent 6c9e8d51c2
commit 17b3709790

View File

@ -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){