Check digit corrections from Massimo

This commit is contained in:
hooper114 2009-07-04 20:49:17 +00:00
parent 2145673ce4
commit cec3babc89
2 changed files with 3 additions and 2 deletions

View File

@ -272,11 +272,11 @@ int itf14(struct zint_symbol *symbol, unsigned char source[])
/* Calculate the check digit - the same method used for EAN-13 */ /* 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]); count += ctoi(localstr[i]);
if (!((i%2) == 0)) if ((i%2) == 0)
{ {
count += 2 * ctoi(localstr[i]); count += 2 * ctoi(localstr[i]);
} }

View File

@ -133,6 +133,7 @@ void upce(struct zint_symbol *symbol, unsigned char source[], char dest[])
for(i = 0; i < 11; i++) { for(i = 0; i < 11; i++) {
equivalent[i] = '0'; equivalent[i] = '0';
} }
if(num_system == 1) { equivalent[0] = temp[0]; }
equivalent[1] = source[0]; equivalent[1] = source[0];
equivalent[2] = source[1]; equivalent[2] = source[1];
equivalent[11] = '\0'; equivalent[11] = '\0';