decode: fix reversed tuples in numeric decoder.

This commit is contained in:
Daniel Beer 2013-05-29 09:40:46 +12:00
parent 0335fabf97
commit daf6d7c90b

View file

@ -640,11 +640,12 @@ static int numeric_tuple(struct quirc_data *data,
tuple = get_bits(ds->data, *ptr, bits); tuple = get_bits(ds->data, *ptr, bits);
*ptr += bits; *ptr += bits;
for (i = 0; i < digits; i++) { for (i = digits - 1; i >= 0; i--) {
data->payload[data->payload_len++] = tuple % 10 + '0'; data->payload[data->payload_len + i] = tuple % 10 + '0';
tuple /= 10; tuple /= 10;
} }
data->payload_len += digits;
return 0; return 0;
} }