mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-23 11:36:54 -04:00
Re commit [789e04] and [86363f] allow prefixes without check digit
This commit is contained in:
parent
3592edd64e
commit
51ebca182c
12 changed files with 400 additions and 393 deletions
|
@ -46,12 +46,12 @@ INTERNAL int itf14(struct zint_symbol *symbol, unsigned char source[], int lengt
|
|||
unsigned char have_check_digit = '\0';
|
||||
unsigned char check_digit;
|
||||
|
||||
/* Allow and ignore any AI prefix, but only if have check digit */
|
||||
if (length == 18 && (memcmp(source, "[01]", 4) == 0 || memcmp(source, "(01)", 4) == 0)) {
|
||||
/* Allow and ignore any AI prefix */
|
||||
if ((length == 17 || length == 18) && (memcmp(source, "[01]", 4) == 0 || memcmp(source, "(01)", 4) == 0)) {
|
||||
source += 4;
|
||||
length -= 4;
|
||||
/* Likewise initial '01', if have check digit */
|
||||
} else if (length == 16 && source[0] == '0' && source[1] == '1') {
|
||||
/* Likewise initial '01' */
|
||||
} else if ((length == 15 || length == 16) && source[0] == '0' && source[1] == '1') {
|
||||
source += 2;
|
||||
length -= 2;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue