From 7ae95b2b42217f227d393c8ef8461423859c0f2f Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Sat, 13 Feb 2016 07:58:59 +0000 Subject: [PATCH] Numeric data correction Bugfix by Ed Deinstadt Ref: https://sourceforge.net/p/zint/mailman/message/34362009/ --- backend/maxicode.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/backend/maxicode.c b/backend/maxicode.c index d7a8805b..3dcb6da8 100644 --- a/backend/maxicode.c +++ b/backend/maxicode.c @@ -356,7 +356,7 @@ int maxi_text_process(int mode, unsigned char source[], int length) i = 0; do { - if(set[i] != current_set) { + if((set[i] != current_set) && (set[i] != 6)) { switch(set[i]) { case 1: if(set[i + 1] == 1) { @@ -420,10 +420,6 @@ int maxi_text_process(int mode, unsigned char source[], int length) character[i] = 62; length++; break; - case 6: - /* Number Compressed */ - /* Do nothing */ - break; } i++; } @@ -438,10 +434,10 @@ int maxi_text_process(int mode, unsigned char source[], int length) char substring[11]; int value; - for(j = 0; j < 10; j++) { + for(j = 0; j < 9; j++) { substring[j] = character[i + j]; } - substring[10] = '\0'; + substring[9] = '\0'; value = atoi(substring); character[i] = 31; /* NS */