mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Disallow EAN2 and EAN5 with addon
This commit is contained in:
parent
955c29fc36
commit
f185e85cb9
@ -529,13 +529,18 @@ void ean_leading_zeroes(struct zint_symbol *symbol, unsigned char source[], unsi
|
||||
}
|
||||
|
||||
/* Calculate target lengths */
|
||||
if(second_len <= 5) { zsecond_len = 5; }
|
||||
if(second_len <= 2) { zsecond_len = 2; }
|
||||
if(second_len == 0) { zsecond_len = 0; }
|
||||
switch(symbol->symbology) {
|
||||
case BARCODE_EANX:
|
||||
case BARCODE_EANX_CC:
|
||||
if(first_len <= 12) { zfirst_len = 12; }
|
||||
if(first_len <= 7) { zfirst_len = 7; }
|
||||
if(first_len <= 5) { zfirst_len = 5; }
|
||||
if(first_len <= 2) { zfirst_len = 2; }
|
||||
if(second_len == 0) {
|
||||
if(first_len <= 5) { zfirst_len = 5; }
|
||||
if(first_len <= 2) { zfirst_len = 2; }
|
||||
}
|
||||
break;
|
||||
case BARCODE_UPCA:
|
||||
case BARCODE_UPCA_CC:
|
||||
@ -550,9 +555,7 @@ void ean_leading_zeroes(struct zint_symbol *symbol, unsigned char source[], unsi
|
||||
if(first_len <= 9) { zfirst_len = 9; }
|
||||
break;
|
||||
}
|
||||
if(second_len <= 5) { zsecond_len = 5; }
|
||||
if(second_len <= 2) { zsecond_len = 2; }
|
||||
if(second_len == 0) { zsecond_len = 0; }
|
||||
|
||||
|
||||
/* Add leading zeroes */
|
||||
for(i = 0; i < (zfirst_len - first_len); i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user