mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Check digit corrections from Massimo
This commit is contained in:
parent
2145673ce4
commit
cec3babc89
@ -272,11 +272,11 @@ int itf14(struct zint_symbol *symbol, unsigned char source[])
|
||||
|
||||
/* Calculate the check digit - the same method used for EAN-13 */
|
||||
|
||||
for (i = h - 1; i >= 0; i--)
|
||||
for (i = 12; i >= 0; i--)
|
||||
{
|
||||
count += ctoi(localstr[i]);
|
||||
|
||||
if (!((i%2) == 0))
|
||||
if ((i%2) == 0)
|
||||
{
|
||||
count += 2 * ctoi(localstr[i]);
|
||||
}
|
||||
|
@ -133,6 +133,7 @@ void upce(struct zint_symbol *symbol, unsigned char source[], char dest[])
|
||||
for(i = 0; i < 11; i++) {
|
||||
equivalent[i] = '0';
|
||||
}
|
||||
if(num_system == 1) { equivalent[0] = temp[0]; }
|
||||
equivalent[1] = source[0];
|
||||
equivalent[2] = source[1];
|
||||
equivalent[11] = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user