Comply with Rule 2

This commit is contained in:
hooper114 2009-07-09 09:07:37 +00:00
parent 063ac4ce4f
commit 2c5e7332e9

View File

@ -675,17 +675,35 @@ int ean_128(struct zint_symbol *symbol, unsigned char source[])
for(i = 0; i < read; i++) { for(i = 0; i < read; i++) {
if(set[i] == 'C') { if(set[i] == 'C') {
if(reduced[i] == '[') { if(reduced[i] == '[') {
if(c_count % 2) { set[i - c_count] = 'B'; } if(c_count % 2) {
if((i - c_count) != 0) {
set[i - c_count] = 'B';
} else {
set[i - 1] = 'B';
}
}
c_count = 0; c_count = 0;
} else { } else {
c_count++; c_count++;
} }
} else { } else {
if(c_count % 2) { set[i - c_count] = 'B'; } if(c_count % 2) {
if((i - c_count) != 0) {
set[i - c_count] = 'B';
} else {
set[i - 1] = 'B';
}
}
c_count = 0; c_count = 0;
} }
} }
if(c_count % 2) { set[i - c_count] = 'B'; } if(c_count % 2) {
if((i - c_count) != 0) {
set[i - c_count] = 'B';
} else {
set[i - 1] = 'B';
}
}
/* for(i = 0; i < read; i++) { /* for(i = 0; i < read; i++) {
printf("char %c mode %c\n", reduced[i], set[i]); printf("char %c mode %c\n", reduced[i], set[i]);