Allow lowercase input for VIN codes

This commit is contained in:
Robin Stuart 2018-02-04 08:42:01 +00:00
parent e737f992b5
commit 37d3e60c3a

View File

@ -613,12 +613,6 @@ int vin(struct zint_symbol *symbol, unsigned char source[], int length) {
return ZINT_ERROR_TOO_LONG;
}
// Check input characters, I, O and Q are not allowed
if (is_sane(ARSENIC, source, length) == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "337: Invalid characters in input data");
return ZINT_ERROR_INVALID_DATA;
}
// Pad with zeros
zeros = 17 - length;
@ -631,6 +625,14 @@ int vin(struct zint_symbol *symbol, unsigned char source[], int length) {
local_source[zeros + i] = source[i];
}
to_upper((unsigned char *) local_source);
// Check input characters, I, O and Q are not allowed
if (is_sane(ARSENIC, (unsigned char *) local_source, length) == ZINT_ERROR_INVALID_DATA) {
strcpy(symbol->errtxt, "337: Invalid characters in input data");
return ZINT_ERROR_INVALID_DATA;
}
input_check = local_source[8];
for (i = 0; i < 17; i++) {