Fix a signedness mistake in secp256k1_num_set_hex

We were using a potentially signed char as index in an array.
This commit is contained in:
Pieter Wuille 2014-08-26 15:43:21 +02:00
parent e2beb0bd2d
commit fa492f059d
1 changed files with 1 additions and 1 deletions

View File

@ -300,7 +300,7 @@ void static secp256k1_num_set_hex(secp256k1_num_t *r, const char *a, int alen) {
};
unsigned char num[257] = {};
for (int i=0; i<alen; i++) {
num[i] = cvt[a[i]];
num[i] = cvt[(unsigned char)a[i]];
}
r->limbs = mpn_set_str(r->data, num, alen, 16);
while (r->limbs > 1 && r->data[r->limbs-1] == 0) r->limbs--;