From fdaed0b1c822e367539278ea68e1e7dd2768c63e Mon Sep 17 00:00:00 2001 From: gitlost Date: Tue, 30 Jun 2026 16:35:56 +0100 Subject: [PATCH] AZTEC: fix return type of `az_all_byte_only_or_uld()` char -> int so that the -1 compare doesn't fail on default unsigned char machines (e.g. arm) (ticket #355, props codemonkey82) --- backend/aztec.c | 2 +- backend/tests/test_aztec.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/backend/aztec.c b/backend/aztec.c index 8015691a..9d840fe8 100644 --- a/backend/aztec.c +++ b/backend/aztec.c @@ -410,7 +410,7 @@ static int az_text_modes(char modes[], unsigned char source[], const int length, /* Cheapo to check if input all of one type of Byte-only, Upper, Lower or Digit, returning AZ_B, AZ_U, AZ_L or AZ_D resp., or -1 if not */ -static char az_all_byte_only_or_uld(const unsigned char source[], const int length) { +static int az_all_byte_only_or_uld(const unsigned char source[], const int length) { int i; int byte_only, upper, lower, digit; diff --git a/backend/tests/test_aztec.c b/backend/tests/test_aztec.c index 36256eff..4638a8ae 100644 --- a/backend/tests/test_aztec.c +++ b/backend/tests/test_aztec.c @@ -9877,6 +9877,31 @@ static void test_fuzz(const testCtx *const p_ctx) { "\x25\xaa\x8f\x7c\x21\xd6\xfd\xa5\x2b\x4e\xc7\x48\x52\xdb\xa8\xde\x59\x64\x11\xb3\x32\x70\x98\x60\x12\x52\x1b\x39\xc2\xc3\x17\xd3\xd1\x40\x6c\x4b\x24\x57\x18", 1359, 0, "", 899 }, /* #347 Francois Grieu */ + /* 14*/ { BARCODE_AZTEC, DATA_MODE | FAST_MODE, -1, -1, + "\x5B\x29\x3E\x7E\x44\x33\x30\x30\x31\x7E\x44\x32\x39\x30\x32\x38\x39\x30\x37\x35\x20\x20\x20\x20\x7E\x44\x32\x39\x20\x20\x20\x7E\x44\x32\x39\x20\x20\x20\x7E\x44" + "\x32\x39\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x32\x39\x47\x45\x4F\x50\x7E\x44\x32\x39\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" + "\x20\x20\x20\x20\x20\x7E\x44\x32\x39\x30\x30\x31\x7E\x44\x32\x39\x30\x30\x30\x35\x37\x37\x30\x32\x32\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x32\x39\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x32\x39\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x32\x39\x4E\x7E\x44" + "\x32\x39\x4D\x75\x73\x74\x65\x72\x73\x74\x72\x61\x73\x73\x65\x20\x31\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44" + "\x32\x39\x55\x6C\x6D\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x32" + "\x39\x4D\x61\x78\x20\x4D\x75\x73\x74\x65\x72\x6D\x61\x6E\x6E\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x32\x39" + "\x7E\x44\x33\x30\x30\x37\x7E\x44\x32\x39\x47\x30\x32\x7E\x44\x32\x39\x30\x7E\x44\x32\x39\x30\x7E\x44\x32\x39\x30\x7E\x44\x32\x39\x7E\x44\x33\x31\x20\x20\x20\x20" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x33\x31\x7E\x44\x33\x31\x30" + "\x36\x37\x30\x34\x31\x33\x38\x38\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x33\x31\x7E\x44\x33\x31\x7E\x44\x33\x31\x20\x20\x20\x20" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" + "\x20\x20\x20\x20\x20\x20\x7E\x44\x33\x31\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x33\x31\x7E\x44\x33\x31\x7E\x44\x33\x31\x7E\x44\x32\x39\x7E\x44\x32\x39\x7E\x44" + "\x32\x39\x7E\x44\x32\x39\x30\x30\x30\x30\x32\x30\x34\x33\x33\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" + "\x20\x7E\x44\x32\x39\x4B\x47\x4F\x06\x30\x37\x32\x30\x32\x31\x00\x36\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x32\x39" + "\x7E\x44\x32\x39\x7E\x44\x32\x39\x4B\x47\x4F\x06\x30\x37\x32\x30\x32\x31\x00\x36\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E" + "\x44\x32\x39\x7E\x44\x32\x39\x7E\x44\x33\x30\x30\x37\x7E\x44\x32\x39\x53\x30\x31\x30\x7E\x44\x32\x39\x58\x58\x58\x58\x20\x58\x58\x58\x58\x58\x58\x58\x58\x20\x58" + "\x58\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x33\x31\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20" + "\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x33\x31\x7E\x44\x33\x31\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x33\x31\x58\x58\x20\x58\x58\x58\x20\x58\x58\x58\x58" + "\x58\x58\x58\x58\x58\x20\x34\x30\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x33\x31\x7E\x44\x33\x31\x58\x58\x58\x58\x58\x58\x58\x58" + "\x58\x58\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x7E\x44\x33\x31\x38\x39\x35\x32\x30\x20\x20\x20\x20" + "\x7E\x44\x33\x31\x32\x37\x36\x7E\x44\x33\x31\x7E\x44\x33\x30\x30\x37\x7E\x44\x32\x39\x53\x30\x32\x30\x7E\x44\x32\x39\x7E\x44\x32\x39\x7E\x44\x32\x39\x7E\x44\x32" + "\x39\x7E\x44\x33\x30\x30\x37\x7E\x44\x32\x39\x53\x30\x33\x30\x7E\x44\x32\x39\x7E\x44\x32\x39", + 864, 0, "", -1 + }, /* #355 codemonkey82 */ }; const int data_size = ARRAY_SIZE(data); int i, length, ret;