From 798db42416752b2593a3332ff6a7c9679f260eee Mon Sep 17 00:00:00 2001 From: hooper114 Date: Thu, 26 Feb 2009 06:48:20 +0000 Subject: [PATCH] End of string bugfix --- backend/dm200.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/dm200.c b/backend/dm200.c index 40f663b6..888ed9b0 100644 --- a/backend/dm200.c +++ b/backend/dm200.c @@ -637,42 +637,42 @@ int dm200encode(struct zint_symbol *symbol, unsigned char source[], unsigned cha /* Empty buffers */ if(c40_p == 2) { target[tp] = 254; tp++; /* unlatch */ + target[tp] = source[inputlen - 2] + 1; tp++; target[tp] = source[inputlen - 1] + 1; tp++; - target[tp] = source[inputlen] + 1; tp++; concat(binary, " "); current_mode = DM_ASCII; } if(c40_p == 1) { target[tp] = 254; tp++; /* unlatch */ - target[tp] = source[inputlen] + 1; tp++; + target[tp] = source[inputlen - 1] + 1; tp++; concat(binary, " "); current_mode = DM_ASCII; } if(text_p == 2) { target[tp] = 254; tp++; /* unlatch */ + target[tp] = source[inputlen - 2] + 1; tp++; target[tp] = source[inputlen - 1] + 1; tp++; - target[tp] = source[inputlen] + 1; tp++; concat(binary, " "); current_mode = DM_ASCII; } if(text_p == 1) { target[tp] = 254; tp++; /* unlatch */ - target[tp] = source[inputlen] + 1; tp++; + target[tp] = source[inputlen - 1] + 1; tp++; concat(binary, " "); current_mode = DM_ASCII; } if(x12_p == 2) { target[tp] = 254; tp++; /* unlatch */ + target[tp] = source[inputlen - 2] + 1; tp++; target[tp] = source[inputlen - 1] + 1; tp++; - target[tp] = source[inputlen] + 1; tp++; concat(binary, " "); current_mode = DM_ASCII; } if(x12_p == 1) { target[tp] = 254; tp++; /* unlatch */ - target[tp] = source[inputlen] + 1; tp++; + target[tp] = source[inputlen - 1] + 1; tp++; concat(binary, " "); current_mode = DM_ASCII; }