Resolve bug when Maxicode mode set by user.

If you invoke the program with --mode=2 or --mode=3 zint reports the error
"Invalid Primary String".
Fixed by Travis Waalkens.
This commit is contained in:
Robin Stuart 2011-03-08 10:33:22 +00:00
parent cc5e18211b
commit 533a5d0453

View File

@ -602,6 +602,9 @@ int maxicode(struct zint_symbol *symbol, unsigned char source[], int length)
}
if((mode == 2) || (mode == 3)) { /* Modes 2 and 3 need data in symbol->primary */
if(lp == 0){ /* Mode set manually means lp doesn't get set */
lp = strlen( symbol->primary );
}
if(lp != 15) {
strcpy(symbol->errtxt, "Invalid Primary String");
return ERROR_INVALID_DATA;