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:
@ -66,7 +66,7 @@ int telepen(struct zint_symbol *symbol, unsigned char source[], int src_len) {
|
||||
count = 0;
|
||||
|
||||
if (src_len > 30) {
|
||||
strcpy(symbol->errtxt, "Input too long");
|
||||
strcpy(symbol->errtxt, "Input too long (C90)");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
/* Start character */
|
||||
@ -75,7 +75,7 @@ int telepen(struct zint_symbol *symbol, unsigned char source[], int src_len) {
|
||||
for (i = 0; i < src_len; i++) {
|
||||
if (source[i] > 126) {
|
||||
/* Cannot encode extended ASCII */
|
||||
strcpy(symbol->errtxt, "Invalid characters in input data");
|
||||
strcpy(symbol->errtxt, "Invalid characters in input data (C91)");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
strcat(dest, TeleTable[source[i]]);
|
||||
@ -113,14 +113,14 @@ int telepen_num(struct zint_symbol *symbol, unsigned char source[], int src_len)
|
||||
count = 0;
|
||||
|
||||
if (temp_length > 60) {
|
||||
strcpy(symbol->errtxt, "Input too long");
|
||||
strcpy(symbol->errtxt, "Input too long (C92)");
|
||||
return ZINT_ERROR_TOO_LONG;
|
||||
}
|
||||
ustrcpy(temp, source);
|
||||
to_upper(temp);
|
||||
error_number = is_sane(NEON, temp, temp_length);
|
||||
if (error_number == ZINT_ERROR_INVALID_DATA) {
|
||||
strcpy(symbol->errtxt, "Invalid characters in data");
|
||||
strcpy(symbol->errtxt, "Invalid characters in data (C93)");
|
||||
return error_number;
|
||||
}
|
||||
|
||||
@ -137,7 +137,7 @@ int telepen_num(struct zint_symbol *symbol, unsigned char source[], int src_len)
|
||||
|
||||
for (i = 0; i < temp_length; i += 2) {
|
||||
if (temp[i] == 'X') {
|
||||
strcpy(symbol->errtxt, "Invalid position of X in Telepen data");
|
||||
strcpy(symbol->errtxt, "Invalid position of X in Telepen data (C94)");
|
||||
return ZINT_ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user