mirror of
https://git.code.sf.net/p/zint/code
synced 2025-06-01 07:38:26 -04:00
Audit of error codes
This commit is contained in:
parent
58e80a9ff7
commit
608b4b9134
38 changed files with 345 additions and 345 deletions
|
@ -79,17 +79,17 @@ int gs1_verify(struct zint_symbol *symbol, const unsigned char source[], const s
|
|||
/* Detect extended ASCII characters */
|
||||
for (i = 0; i < src_len; i++) {
|
||||
if (source[i] >= 128) {
|
||||
strcpy(symbol->errtxt, "Extended ASCII characters are not supported by GS1 (B50)");
|
||||
strcpy(symbol->errtxt, "250: Extended ASCII characters are not supported by GS1");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
if (source[i] < 32) {
|
||||
strcpy(symbol->errtxt, "Control characters are not supported by GS1 (B51)");
|
||||
strcpy(symbol->errtxt, "251: Control characters are not supported by GS1 ");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
}
|
||||
|
||||
if (source[0] != '[') {
|
||||
strcpy(symbol->errtxt, "Data does not start with an AI (B52)");
|
||||
strcpy(symbol->errtxt, "252: Data does not start with an AI");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
|
@ -129,31 +129,31 @@ int gs1_verify(struct zint_symbol *symbol, const unsigned char source[], const s
|
|||
|
||||
if (bracket_level != 0) {
|
||||
/* Not all brackets are closed */
|
||||
strcpy(symbol->errtxt, "Malformed AI in input data (brackets don\'t match) (B53)");
|
||||
strcpy(symbol->errtxt, "253: Malformed AI in input data (brackets don\'t match)");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
if (max_bracket_level > 1) {
|
||||
/* Nested brackets */
|
||||
strcpy(symbol->errtxt, "Found nested brackets in input data (B54)");
|
||||
strcpy(symbol->errtxt, "254: Found nested brackets in input data");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
if (max_ai_length > 4) {
|
||||
/* AI is too long */
|
||||
strcpy(symbol->errtxt, "Invalid AI in input data (AI too long) (B55)");
|
||||
strcpy(symbol->errtxt, "255: Invalid AI in input data (AI too long)");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
if (min_ai_length <= 1) {
|
||||
/* AI is too short */
|
||||
strcpy(symbol->errtxt, "Invalid AI in input data (AI too short) (B56)");
|
||||
strcpy(symbol->errtxt, "256: Invalid AI in input data (AI too short)");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
if (ai_latch == 1) {
|
||||
/* Non-numeric data in AI */
|
||||
strcpy(symbol->errtxt, "Invalid AI in input data (non-numeric characters in AI) (B57)");
|
||||
strcpy(symbol->errtxt, "257: Invalid AI in input data (non-numeric characters in AI)");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
|
@ -190,7 +190,7 @@ int gs1_verify(struct zint_symbol *symbol, const unsigned char source[], const s
|
|||
for (i = 0; i < ai_count; i++) {
|
||||
if (data_length[i] == 0) {
|
||||
/* No data for given AI */
|
||||
strcpy(symbol->errtxt, "Empty data field in input data (B58)");
|
||||
strcpy(symbol->errtxt, "258: Empty data field in input data");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
}
|
||||
|
@ -286,13 +286,13 @@ int gs1_verify(struct zint_symbol *symbol, const unsigned char source[], const s
|
|||
}
|
||||
|
||||
if (error_latch == 5) {
|
||||
strcpy(symbol->errtxt, "Invalid data length for AI (B59)");
|
||||
strcpy(symbol->errtxt, "259: Invalid data length for AI ");
|
||||
strcat(symbol->errtxt, ai_string);
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
if (error_latch == 6) {
|
||||
strcpy(symbol->errtxt, "Invalid AI value (B60)");
|
||||
strcpy(symbol->errtxt, "260: Invalid AI value");
|
||||
strcat(symbol->errtxt, ai_string);
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
@ -353,6 +353,6 @@ int ugs1_verify(struct zint_symbol *symbol, const unsigned char source[], const
|
|||
ustrcpy(reduced, (unsigned char*) temp);
|
||||
return 0;
|
||||
}
|
||||
strcpy(symbol->errtxt, "ugs1_verify overflow (B61)");
|
||||
strcpy(symbol->errtxt, "261: ugs1_verify overflow");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue