bugfix: Corruption of output_options data

This commit is contained in:
Robin Stuart 2016-08-26 12:15:54 +01:00
parent 542ec7c7a5
commit c6a68dd605
2 changed files with 5 additions and 5 deletions

View File

@ -329,7 +329,7 @@ int code_49(struct zint_symbol *symbol, unsigned char source[], const int length
}
symbol->whitespace_width = 10;
symbol->output_options = BARCODE_BIND;
symbol->output_options += BARCODE_BIND;
symbol->border_width = 2;
return 0;

View File

@ -570,13 +570,13 @@ static int reduced_charset(struct zint_symbol *symbol, const unsigned char *sour
if (symbol->symbology == BARCODE_CODE16K) {
symbol->whitespace_width = 16;
symbol->border_width = 2;
symbol->output_options = BARCODE_BIND;
symbol->output_options += BARCODE_BIND;
}
if (symbol->symbology == BARCODE_ITF14) {
symbol->whitespace_width = 20;
symbol->border_width = 8;
symbol->output_options = BARCODE_BOX;
symbol->output_options += BARCODE_BOX;
}
switch (symbol->input_mode) {
@ -1032,7 +1032,7 @@ int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle) {
return ZINT_ERROR_INVALID_OPTION;
}
if (symbol->output_options &= BARCODE_DOTTY_MODE) {
if (symbol->output_options & BARCODE_DOTTY_MODE) {
if (!(is_matrix(symbol->symbology))) {
strcpy(symbol->errtxt, "Selected symbology cannot be rendered as dots");
return ZINT_ERROR_INVALID_OPTION;