mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
tidy up
This commit is contained in:
parent
7c30733116
commit
834a689e7c
@ -63,6 +63,10 @@ int gs1_verify(struct zint_symbol *symbol, unsigned char source[], char reduced[
|
|||||||
strcpy(symbol->errtxt, "Extended ASCII characters are not supported by GS1");
|
strcpy(symbol->errtxt, "Extended ASCII characters are not supported by GS1");
|
||||||
return ERROR_INVALID_DATA;
|
return ERROR_INVALID_DATA;
|
||||||
}
|
}
|
||||||
|
if(source[i] < 32) {
|
||||||
|
strcpy(symbol->errtxt, "Control characters are not supported by GS1");
|
||||||
|
return ERROR_INVALID_DATA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(source[0] != '[') {
|
if(source[0] != '[') {
|
||||||
@ -77,8 +81,10 @@ int gs1_verify(struct zint_symbol *symbol, unsigned char source[], char reduced[
|
|||||||
max_ai_length = 0;
|
max_ai_length = 0;
|
||||||
min_ai_length = 5;
|
min_ai_length = 5;
|
||||||
j = 0;
|
j = 0;
|
||||||
|
ai_latch = 0;
|
||||||
for(i = 0; i < ustrlen(source); i++) {
|
for(i = 0; i < ustrlen(source); i++) {
|
||||||
ai_length += j;
|
ai_length += j;
|
||||||
|
if((j == 1) && ((source[i] < '0') || (source[i] > '9'))) { ai_latch = 1; }
|
||||||
if(source[i] == '[') { bracket_level++; j = 1; }
|
if(source[i] == '[') { bracket_level++; j = 1; }
|
||||||
if(source[i] == ']') {
|
if(source[i] == ']') {
|
||||||
bracket_level--;
|
bracket_level--;
|
||||||
|
Loading…
Reference in New Issue
Block a user