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->whitespace_width = 10;
symbol->output_options = BARCODE_BIND; symbol->output_options += BARCODE_BIND;
symbol->border_width = 2; symbol->border_width = 2;
return 0; return 0;

View File

@ -218,7 +218,7 @@ int dump_plot(struct zint_symbol *symbol) {
char hex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', char hex[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'A', 'B', 'C', 'D', 'E', 'F'}; '9', 'A', 'B', 'C', 'D', 'E', 'F'};
int space = 0; int space = 0;
if (symbol->output_options & BARCODE_STDOUT) { if (symbol->output_options & BARCODE_STDOUT) {
f = stdout; f = stdout;
} else { } else {
@ -570,13 +570,13 @@ static int reduced_charset(struct zint_symbol *symbol, const unsigned char *sour
if (symbol->symbology == BARCODE_CODE16K) { if (symbol->symbology == BARCODE_CODE16K) {
symbol->whitespace_width = 16; symbol->whitespace_width = 16;
symbol->border_width = 2; symbol->border_width = 2;
symbol->output_options = BARCODE_BIND; symbol->output_options += BARCODE_BIND;
} }
if (symbol->symbology == BARCODE_ITF14) { if (symbol->symbology == BARCODE_ITF14) {
symbol->whitespace_width = 20; symbol->whitespace_width = 20;
symbol->border_width = 8; symbol->border_width = 8;
symbol->output_options = BARCODE_BOX; symbol->output_options += BARCODE_BOX;
} }
switch (symbol->input_mode) { switch (symbol->input_mode) {
@ -1032,7 +1032,7 @@ int ZBarcode_Print(struct zint_symbol *symbol, int rotate_angle) {
return ZINT_ERROR_INVALID_OPTION; return ZINT_ERROR_INVALID_OPTION;
} }
if (symbol->output_options &= BARCODE_DOTTY_MODE) { if (symbol->output_options & BARCODE_DOTTY_MODE) {
if (!(is_matrix(symbol->symbology))) { if (!(is_matrix(symbol->symbology))) {
strcpy(symbol->errtxt, "Selected symbology cannot be rendered as dots"); strcpy(symbol->errtxt, "Selected symbology cannot be rendered as dots");
return ZINT_ERROR_INVALID_OPTION; return ZINT_ERROR_INVALID_OPTION;