Cast to unsigned any chars read from the buffer while computing lengths
during rnet message parsing.
Remove unused variable while at that.
int b;
char *key;
int klen;
- char *kcopy;
/* skip first byte */
i++;
while (i < len) {
- j = buffer[i];
+ j = (unsigned char)buffer[i];
b = j & 0x80;
if (b)
;
key = buffer + i;
klen = j;
i += j;
- j = buffer[i];
+ j = (unsigned char)buffer[i];
i++;
if (b)
- j = j << 8 | buffer[i++];
+ j = j << 8 | (unsigned char)buffer[i++];
*value = buffer + i;
*vlen = j;
i += j;