diff --git a/backend/gs1.c b/backend/gs1.c index b477751b..39791f8e 100644 --- a/backend/gs1.c +++ b/backend/gs1.c @@ -494,7 +494,7 @@ INTERNAL int gs1_verify(struct zint_symbol *symbol, const unsigned char source[] } if (ai_value[i] == 253) { // GDTI - if ((data_length[i] < 14) || (data_length[i] > 30)) { + if ((data_length[i] < 13) || (data_length[i] > 30)) { error_latch = 1; } else { error_latch = 0; @@ -502,7 +502,7 @@ INTERNAL int gs1_verify(struct zint_symbol *symbol, const unsigned char source[] } if (ai_value[i] == 255) { // GCN - if ((data_length[i] < 14) || (data_length[i] > 25)) { + if ((data_length[i] < 13) || (data_length[i] > 25)) { error_latch = 1; } else { error_latch = 0; diff --git a/backend/tests/test_gs1.c b/backend/tests/test_gs1.c index ee1b3b7c..ecdcb488 100644 --- a/backend/tests/test_gs1.c +++ b/backend/tests/test_gs1.c @@ -349,10 +349,14 @@ static void test_gs1_verify(int index) { /* 64*/ { "[251]abcdefghijklmnopqrstuvwxyz1234", 0, "251abcdefghijklmnopqrstuvwxyz1234" }, /* 65*/ { "[251]abcdefghijklmnopqrstuvwxyz12345", ZINT_ERROR_INVALID_DATA, "" }, /* 66*/ { "[252]1234", ZINT_ERROR_INVALID_DATA, "" }, + /* 67*/ { "[253]131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /* 67*/ { "[253]1313131313134", 0, "2531313131313134" }, /* 67*/ { "[253]131313131313412345678901234567", 0, "253131313131313412345678901234567" }, - /* 68*/ { "[253]13131313131341234567890123345678", ZINT_ERROR_INVALID_DATA, "" }, + /* 68*/ { "[253]1313131313134123456789012345678", ZINT_ERROR_INVALID_DATA, "" }, /* 69*/ { "[254]abcdefghijklmnopqrst", 0, "254abcdefghijklmnopqrst" }, /* 70*/ { "[254]abcdefghijklmnopqrstu", ZINT_ERROR_INVALID_DATA, "" }, + /* 71*/ { "[255]131313131313", ZINT_ERROR_INVALID_DATA, "" }, + /* 71*/ { "[255]1313131313134", 0, "2551313131313134" }, /* 71*/ { "[255]1313131313134123456789012", 0, "2551313131313134123456789012" }, /* 72*/ { "[255]13131313131341234567890123", ZINT_ERROR_INVALID_DATA, "" }, /* 73*/ { "[256]1234", ZINT_ERROR_INVALID_DATA, "" },