1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-06-10 07:33:43 +00:00

GS1SE: fix bug in allowing initial GSs in GS1RAW_MODE in composites

This commit is contained in:
gitlost
2026-02-26 16:34:59 +00:00
parent 0a8a79fa6c
commit 9ef5bc7298
2 changed files with 57 additions and 48 deletions
+7 -5
View File
@@ -1710,23 +1710,25 @@ static int gs1se_verify(struct zint_symbol *symbol, const unsigned char source[]
/* Need to add initial carets */
local_source_buf[0] = '^';
local_length = 1;
/* Linear GSs */
if (symbol->primary[0] == '\x1D') { /* Allow initial GS */
gs1se_gs_caret_sub(ZCUCP(symbol->primary + 1), primary_len - 1, local_source_buf + 1); /* Linear GSs */
gs1se_gs_caret_sub(ZCUCP(symbol->primary + 1), primary_len - 1, local_source_buf + local_length);
local_length += primary_len - 1;
} else {
gs1se_gs_caret_sub(ZCUCP(symbol->primary), primary_len, local_source_buf + 1); /* Linear GSs */
gs1se_gs_caret_sub(ZCUCP(symbol->primary), primary_len, local_source_buf + local_length);
local_length += primary_len;
}
local_source_buf[local_length++] = '|';
local_source_buf[local_length++] = '^';
/* CC GSs */
if (source[0] == '\x1D') { /* Allow initial GS */
gs1se_gs_caret_sub(source + 1, length - 1, local_source_buf + primary_len + 3); /* CC GSs */
gs1se_gs_caret_sub(source + 1, length - 1, local_source_buf + local_length);
local_length += length - 1;
} else {
gs1se_gs_caret_sub(source, length, local_source_buf + primary_len + 3); /* CC GSs */
gs1se_gs_caret_sub(source, length, local_source_buf + local_length);
local_length += length;
}
linear_len = primary_len;
linear_len = primary_len - (symbol->primary[0] == '\x1D'); /* Exclude initial GS if any */
} else {
memcpy(local_source_buf, symbol->primary, primary_len);
local_source_buf[primary_len] = '|';