/*
* Copyright (C) 2013 Thadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
+ * Copyright (C) 2014 Alexandre Oliva <lxoliva@fsfla.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
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;