From 5c9d127ad1684da28e9da309161636bacf1b104a Mon Sep 17 00:00:00 2001 From: Harald Oehlmann Date: Wed, 18 Sep 2019 10:51:01 +0200 Subject: [PATCH] 2019-09-19 HaO DM: when encoding ECI, data scrambled when base256 encoding was chosen. The ECI codeword 241 was missing in the binary marker array and thus, the binrary length was inserted before the latch to binary resulting in very corrupt data. --- backend/dmatrix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/dmatrix.c b/backend/dmatrix.c index 871b3b21..4c767da8 100644 --- a/backend/dmatrix.c +++ b/backend/dmatrix.c @@ -588,14 +588,14 @@ static int dm200encode(struct zint_symbol *symbol, const unsigned char source[], if (symbol->eci <= 126) { target[tp] = (unsigned char) symbol->eci + 1; tp++; - strcat(binary, " "); + strcat(binary, " "); } if ((symbol->eci >= 127) && (symbol->eci <= 16382)) { target[tp] = (unsigned char) ((symbol->eci - 127) / 254) + 128; tp++; target[tp] = (unsigned char) ((symbol->eci - 127) % 254) + 1; tp++; - strcat(binary, " "); + strcat(binary, " "); } if (symbol->eci >= 16383) { target[tp] = (unsigned char) ((symbol->eci - 16383) / 64516) + 192; @@ -604,7 +604,7 @@ static int dm200encode(struct zint_symbol *symbol, const unsigned char source[], tp++; target[tp] = (unsigned char) ((symbol->eci - 16383) % 254) + 1; tp++; - strcat(binary, " "); + strcat(binary, " "); } if (debug) printf("ECI %d ", symbol->eci + 1); }