From eb3a004aceb1ffad12d2b02e71b835f77cf462c0 Mon Sep 17 00:00:00 2001 From: Robin Stuart Date: Sat, 5 Oct 2019 12:48:55 +0100 Subject: [PATCH] Always latch to non-numeric in general-purpose field Would not include latch to alphanumeric or ISO/IEC mode if required at the beginning of a general-purpose compaction field. Fixes #146 reported by Gregory Van Vooren --- backend/composite.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/composite.c b/backend/composite.c index bffd0383..21a4bea4 100644 --- a/backend/composite.c +++ b/backend/composite.c @@ -1421,6 +1421,8 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha if (general_field_type[i - 1] == ISOIEC) { bin_append(4, 5, binary_string); /* ISO/IEC 646 latch */ } + } else { + bin_append(0, 4, binary_string); /* Alphanumeric latch */ } if ((general_field[i] >= '0') && (general_field[i] <= '9')) { @@ -1465,6 +1467,9 @@ static int cc_binary_string(struct zint_symbol *symbol, const char source[], cha if (general_field_type[i - 1] == ALPHA) { bin_append(4, 5, binary_string);; /* ISO/IEC 646 latch */ } + } else { + bin_append(0, 4, binary_string); /* Alphanumeric latch */ + bin_append(4, 5, binary_string); /* ISO/IEC 646 latch */ } if ((general_field[i] >= '0') && (general_field[i] <= '9')) {