gs1: csumalpha: improve warning, report both checksum chars

(ticket #332, props Harald Oehlmann)
This commit is contained in:
gitlost 2025-03-18 18:47:04 +00:00
parent de8a62ca2a
commit d1bf02e156
3 changed files with 598 additions and 597 deletions

View file

@ -21,6 +21,8 @@ Changes
`option_1` by setting to -1 (min 3 words), 0 (<5% + 3 words) `option_1` by setting to -1 (min 3 words), 0 (<5% + 3 words)
- Better warning messages on non-compliant heights - Better warning messages on non-compliant heights
- composite: warn if CC type upped from requested - composite: warn if CC type upped from requested
- gs1: csumalpha: improve warning, report both chars (ticket #332, props Harald
Oehlmann)
Bugs Bugs
---- ----

View file

@ -255,14 +255,8 @@ static int csumalpha(const unsigned char *data, int data_len, int offset, int mi
if (de[0] != c1 || de[1] != c2) { if (de[0] != c1 || de[1] != c2) {
*p_err_no = 3; *p_err_no = 3;
if (de[0] != c1) {
*p_err_posn = (de - data) + 1; *p_err_posn = (de - data) + 1;
(void) gs1_err_msg_printf_nochk(err_msg, "Bad checksum '%c', expected '%c'", de[0], c1); return gs1_err_msg_printf_nochk(err_msg, "Bad checksum '%.2s', expected '%c%c'", de, c1, c2);
} else {
*p_err_posn = (de + 1 - data) + 1;
(void) gs1_err_msg_printf_nochk(err_msg, "Bad checksum '%c', expected '%c'", de[1], c2);
}
return 0;
} }
} }

File diff suppressed because it is too large Load diff