Audit of error codes

This commit is contained in:
Robin Stuart 2017-07-27 16:01:53 +01:00
parent 58e80a9ff7
commit 608b4b9134
38 changed files with 345 additions and 345 deletions

View file

@ -92,12 +92,12 @@ int postnet(struct zint_symbol *symbol, unsigned char source[], char dest[], int
error_number = 0;
if (length > 38) {
strcpy(symbol->errtxt, "Input too long (D80)");
strcpy(symbol->errtxt, "480: Input too long");
return ZINT_ERROR_TOO_LONG;
}
error_number = is_sane(NEON, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data (D81)");
strcpy(symbol->errtxt, "481: Invalid characters in data");
return error_number;
}
sum = 0;
@ -158,12 +158,12 @@ int planet(struct zint_symbol *symbol, unsigned char source[], char dest[], int
error_number = 0;
if (length > 38) {
strcpy(symbol->errtxt, "Input too long (D82)");
strcpy(symbol->errtxt, "482: Input too long");
return ZINT_ERROR_TOO_LONG;
}
error_number = is_sane(NEON, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data (D83)");
strcpy(symbol->errtxt, "483: Invalid characters in data");
return error_number;
}
sum = 0;
@ -222,12 +222,12 @@ int korea_post(struct zint_symbol *symbol, unsigned char source[], int length) {
error_number = 0;
if (length > 6) {
strcpy(symbol->errtxt, "Input too long (D84)");
strcpy(symbol->errtxt, "484: Input too long");
return ZINT_ERROR_TOO_LONG;
}
error_number = is_sane(NEON, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data (D85)");
strcpy(symbol->errtxt, "485: Invalid characters in data");
return error_number;
}
zeroes = 6 - length;
@ -262,7 +262,7 @@ int fim(struct zint_symbol *symbol, unsigned char source[], int length) {
char dest[16] = {0};
if (length > 1) {
strcpy(symbol->errtxt, "Input too long (D86)");
strcpy(symbol->errtxt, "486: Input too long");
return ZINT_ERROR_TOO_LONG;
}
@ -284,7 +284,7 @@ int fim(struct zint_symbol *symbol, unsigned char source[], int length) {
strcpy(dest, "1111131311111");
break;
default:
strcpy(symbol->errtxt, "Invalid characters in data (D87)");
strcpy(symbol->errtxt, "487: Invalid characters in data");
return ZINT_ERROR_INVALID_DATA;
break;
}
@ -341,13 +341,13 @@ int royal_plot(struct zint_symbol *symbol, unsigned char source[], int length) {
error_number = 0;
if (length > 50) {
strcpy(symbol->errtxt, "Input too long (D88)");
strcpy(symbol->errtxt, "488: Input too long");
return ZINT_ERROR_TOO_LONG;
}
to_upper(source);
error_number = is_sane(KRSET, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data (D89)");
strcpy(symbol->errtxt, "489: Invalid characters in data");
return error_number;
}
/*check = */rm4scc((char*) source, (unsigned char*) height_pattern, length);
@ -387,13 +387,13 @@ int kix_code(struct zint_symbol *symbol, unsigned char source[], int length) {
error_number = 0;
if (length > 18) {
strcpy(symbol->errtxt, "Input too long (D8A)");
strcpy(symbol->errtxt, "490: Input too long");
return ZINT_ERROR_TOO_LONG;
}
to_upper(source);
error_number = is_sane(KRSET, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data (D8B)");
strcpy(symbol->errtxt, "491: Invalid characters in data");
return error_number;
}
@ -435,14 +435,14 @@ int daft_code(struct zint_symbol *symbol, unsigned char source[], int length) {
error_number = 0;
if (length > 50) {
strcpy(symbol->errtxt, "Input too long (D8C)");
strcpy(symbol->errtxt, "492: Input too long");
return ZINT_ERROR_TOO_LONG;
}
to_upper((unsigned char*) source);
error_number = is_sane(DAFTSET, (unsigned char*) source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data (D8D)");
strcpy(symbol->errtxt, "493: Invalid characters in data");
return error_number;
}
@ -491,12 +491,12 @@ int flattermarken(struct zint_symbol *symbol, unsigned char source[], int length
error_number = 0;
if (length > 90) {
strcpy(symbol->errtxt, "Input too long (D8E)");
strcpy(symbol->errtxt, "494: Input too long");
return ZINT_ERROR_TOO_LONG;
}
error_number = is_sane(NEON, source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data (D8F)");
strcpy(symbol->errtxt, "495: Invalid characters in data");
return error_number;
}
*dest = '\0';
@ -523,7 +523,7 @@ int japan_post(struct zint_symbol *symbol, unsigned char source[], int length) {
#endif
if (length > 20) {
strcpy(symbol->errtxt, "Input too long (D8G)");
strcpy(symbol->errtxt, "496: Input too long");
return ZINT_ERROR_TOO_LONG;
}
@ -538,7 +538,7 @@ int japan_post(struct zint_symbol *symbol, unsigned char source[], int length) {
error_number = is_sane(SHKASUTSET, (unsigned char*) local_source, length);
if (error_number == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "Invalid characters in data (D8H)");
strcpy(symbol->errtxt, "497: Invalid characters in data");
return error_number;
}
memset(inter, 'd', 20); /* Pad character CC4 */