mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Add identifiers to error messages
To ease the debug process
This commit is contained in:
@ -60,12 +60,12 @@ int plessey(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
error_number = 0;
|
||||
|
||||
if (length > 65) {
|
||||
strcpy(symbol->errtxt, "Input too long");
|
||||
strcpy(symbol->errtxt, "Input too long (C70)");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
error_number = is_sane(SSET, source, length);
|
||||
if (error_number == ZINT_ERROR_INVALID_DATA) {
|
||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||
strcpy(symbol->errtxt, "Invalid characters in data (C71)");
|
||||
return error_number;
|
||||
}
|
||||
checkptr = (unsigned char *) calloc(1, length * 4 + 8);
|
||||
@ -118,7 +118,7 @@ int msi_plessey(struct zint_symbol *symbol, unsigned char source[], int length)
|
||||
char dest[512]; /* 2 + 55 * 8 + 3 + 1 ~ 512 */
|
||||
|
||||
if (length > 55) {
|
||||
strcpy(symbol->errtxt, "Input too long");
|
||||
strcpy(symbol->errtxt, "Input too long (C72)");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ int msi_plessey_mod10(struct zint_symbol *symbol, unsigned char source[], int le
|
||||
error_number = 0;
|
||||
|
||||
if (length > 18) {
|
||||
strcpy(symbol->errtxt, "Input too long");
|
||||
strcpy(symbol->errtxt, "Input too long (C73)");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ int msi_plessey_mod1010(struct zint_symbol *symbol, unsigned char source[], cons
|
||||
|
||||
if (src_len > 18) {
|
||||
/* No Entry Stack Smashers! limit because of str->number conversion*/
|
||||
strcpy(symbol->errtxt, "Input too long");
|
||||
strcpy(symbol->errtxt, "Input too long (C74)");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
|
||||
@ -319,7 +319,7 @@ int msi_plessey_mod11(struct zint_symbol *symbol, unsigned char source[], const
|
||||
error_number = 0;
|
||||
|
||||
if (src_len > 55) {
|
||||
strcpy(symbol->errtxt, "Input too long");
|
||||
strcpy(symbol->errtxt, "Input too long (C75)");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
|
||||
@ -381,7 +381,7 @@ int msi_plessey_mod1110(struct zint_symbol *symbol, unsigned char source[], cons
|
||||
error_number = 0;
|
||||
|
||||
if (src_len > 18) {
|
||||
strcpy(symbol->errtxt, "Input too long");
|
||||
strcpy(symbol->errtxt, "Input too long (C76)");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
|
||||
@ -467,7 +467,7 @@ int msi_handle(struct zint_symbol *symbol, unsigned char source[], int length) {
|
||||
|
||||
error_number = is_sane(NEON, source, length);
|
||||
if (error_number != 0) {
|
||||
strcpy(symbol->errtxt, "Invalid characters in input data");
|
||||
strcpy(symbol->errtxt, "Invalid characters in input data (C77)");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user