numpack.c (dovecot-2.3.16) | : | numpack.c (dovecot-2.3.17) | ||
---|---|---|---|---|
skipping to change at line 19 | skipping to change at line 19 | |||
/* number continues as long as the highest bit is set */ | /* number continues as long as the highest bit is set */ | |||
while (num >= 0x80) { | while (num >= 0x80) { | |||
buffer_append_c(buf, (num & 0x7f) | 0x80); | buffer_append_c(buf, (num & 0x7f) | 0x80); | |||
num >>= 7; | num >>= 7; | |||
} | } | |||
buffer_append_c(buf, num); | buffer_append_c(buf, num); | |||
} | } | |||
int numpack_decode(const uint8_t **p, const uint8_t *end, uint64_t *num_r) | int numpack_decode(const uint8_t **p, const uint8_t *end, uint64_t *num_r) | |||
ATTR_UNSIGNED_WRAPS | ||||
{ | { | |||
const uint8_t *c = *p; | const uint8_t *c = *p; | |||
uint64_t value = 0; | uint64_t value = 0; | |||
unsigned int bits = 0; | unsigned int bits = 0; | |||
while (bits < 64) { | while (bits < 64) { | |||
if (c == end) | if (c == end) | |||
return -1; | return -1; | |||
value |= (uint64_t)(*c & 0x7f) << bits; | value |= (uint64_t)(*c & 0x7f) << bits; | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added |