Updated error handling

This commit is contained in:
hooper114
2008-10-05 05:51:58 +00:00
parent 79efc11936
commit 844dfdebef
23 changed files with 286 additions and 353 deletions

View File

@ -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;
}