decode: fix reversed tuples in numeric decoder.
This commit is contained in:
parent
0335fabf97
commit
daf6d7c90b
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue