CODE128/EAN14: fix debug printf bar spaces (not NUL-terminated)

This commit is contained in:
gitlost 2021-11-21 15:49:32 +00:00
parent e14d9e99d5
commit 9e4ecb638f

View File

@ -712,7 +712,7 @@ INTERNAL int code128(struct zint_symbol *symbol, unsigned char source[], int len
printf(" %d", values[i]); printf(" %d", values[i]);
} }
printf(" (%d)\n", bar_characters); printf(" (%d)\n", bar_characters);
printf("Barspaces: %s\n", dest); printf("Barspaces: %.*s\n", (int) (d - dest), dest);
} }
#ifdef ZINT_TEST #ifdef ZINT_TEST
if (symbol->debug & ZINT_DEBUG_TEST) { if (symbol->debug & ZINT_DEBUG_TEST) {
@ -951,7 +951,7 @@ INTERNAL int gs1_128_cc(struct zint_symbol *symbol, unsigned char source[], int
printf(" %d", values[i]); printf(" %d", values[i]);
} }
printf(" (%d)\n", bar_characters); printf(" (%d)\n", bar_characters);
printf("Barspaces: %s\n", dest); printf("Barspaces: %.*s\n", (int) (d - dest), dest);
} }
#ifdef ZINT_TEST #ifdef ZINT_TEST
if (symbol->debug & ZINT_DEBUG_TEST) { if (symbol->debug & ZINT_DEBUG_TEST) {