From c6a68dd605bbfbe37512f1cb96132ee56b8917e2 Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Fri, 26 Aug 2016 12:15:54 +0100 Subject: [PATCH] bugfix: Corruption of output_options data --- backend/code49.c | 2 +- backend/library.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/code49.c b/backend/code49.c index 9b83ed4e..64fe280c 100644 --- a/backend/code49.c +++ b/backend/code49.c @@ -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; diff --git a/backend/library.c b/backend/library.c index 62d594e0..d912dd50 100644 --- a/backend/library.c +++ b/backend/library.c @@ -218,7 +218,7 @@ int dump_plot(struct zint_symbol *symbol) { char hex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; int space = 0; - + if (symbol->output_options & BARCODE_STDOUT) { f = stdout; } else { @@ -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;