diff --git a/backend/code.c b/backend/code.c index 3ad32996..d7b50040 100644 --- a/backend/code.c +++ b/backend/code.c @@ -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++) {