mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Correct ECI but in DotCode
Avoid creating codewords > 112 Fixes #174 reported by Milton Neal
This commit is contained in:
parent
af50515a49
commit
2faff4e76f
@ -496,8 +496,8 @@ static int dotcode_encode_message(struct zint_symbol *symbol, const unsigned cha
|
|||||||
// the next three codewords valued A, B & C encode the ECI value of
|
// the next three codewords valued A, B & C encode the ECI value of
|
||||||
// (A - 40) * 12769 + B * 113 + C + 40 (Section 5.2.1)
|
// (A - 40) * 12769 + B * 113 + C + 40 (Section 5.2.1)
|
||||||
int a, b, c;
|
int a, b, c;
|
||||||
a = (symbol->eci - 40) % 12769;
|
a = (symbol->eci - 40) / 12769;
|
||||||
b = ((symbol->eci - 40) - (12769 * a)) % 113;
|
b = ((symbol->eci - 40) - (12769 * a)) / 113;
|
||||||
c = (symbol->eci - 40) - (12769 * a) - (113 * b);
|
c = (symbol->eci - 40) - (12769 * a) - (113 * b);
|
||||||
|
|
||||||
codeword_array[array_length] = a + 40;
|
codeword_array[array_length] = a + 40;
|
||||||
|
Loading…
Reference in New Issue
Block a user