mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
Updated error handling
This commit is contained in:
@ -313,12 +313,12 @@ int imail(struct zint_symbol *symbol, unsigned char source[])
|
||||
errno = 0;
|
||||
|
||||
if(ustrlen(source) > 32) {
|
||||
strcpy(symbol->errtxt, "error: input too long");
|
||||
strcpy(symbol->errtxt, "Input too long [851]");
|
||||
return ERROR_TOO_LONG;
|
||||
}
|
||||
errno = is_sane(NASET, source);
|
||||
if(errno == ERROR_INVALID_DATA) {
|
||||
strcpy(symbol->errtxt, "error: invalid characters in data");
|
||||
strcpy(symbol->errtxt, "Invalid characters in data [852]");
|
||||
return errno;
|
||||
}
|
||||
|
||||
@ -361,11 +361,11 @@ int imail(struct zint_symbol *symbol, unsigned char source[])
|
||||
}
|
||||
|
||||
if(strlen(tracker) != 20) {
|
||||
strcpy(symbol->errtxt, "error: invalid length tracking code");
|
||||
strcpy(symbol->errtxt, "Invalid length tracking code [853]");
|
||||
return ERROR_INVALID_DATA;
|
||||
}
|
||||
if(strlen(zip) > 11) {
|
||||
strcpy(symbol->errtxt, "error: invalid ZIP code");
|
||||
strcpy(symbol->errtxt, "Invalid ZIP code [854]");
|
||||
return ERROR_INVALID_DATA;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user