Further adjustment for odd-length Mode C blocks

This commit is contained in:
hooper114 2009-07-08 21:37:22 +00:00
parent 5b05d8542c
commit 5ddf28ffbb

View File

@ -675,24 +675,21 @@ int ean_128(struct zint_symbol *symbol, unsigned char source[])
for(i = 0; i < read; i++) {
if(set[i] == 'C') {
if(reduced[i] == '[') {
if(c_count % 2) {
set[i - c_count] = 'B';
if(c_count % 2) { set[i - c_count] = 'B'; }
c_count = 0;
} else {
c_count += 2;
}
} else {
c_count++;
}
} else {
if(c_count % 2)
set[i - c_count] = 'B';
if(c_count % 2) { set[i - c_count] = 'B'; }
c_count = 0;
}
}
if(c_count % 2) {
set[i - c_count] = 'B';
}
if(c_count % 2) { set[i - c_count] = 'B'; }
/* for(i = 0; i < read; i++) {
printf("char %c mode %c\n", reduced[i], set[i]);
} */
/* Now we can calculate how long the barcode is going to be - and stop it from
being too long */