mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-23 19:46:56 -04:00
gs1: csumalpha: improve warning, report both checksum chars
(ticket #332, props Harald Oehlmann)
This commit is contained in:
parent
de8a62ca2a
commit
d1bf02e156
3 changed files with 598 additions and 597 deletions
|
@ -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) {
|
||||
*p_err_no = 3;
|
||||
if (de[0] != c1) {
|
||||
*p_err_posn = (de - data) + 1;
|
||||
(void) gs1_err_msg_printf_nochk(err_msg, "Bad checksum '%c', expected '%c'", de[0], c1);
|
||||
} 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;
|
||||
*p_err_posn = (de - data) + 1;
|
||||
return gs1_err_msg_printf_nochk(err_msg, "Bad checksum '%.2s', expected '%c%c'", de, c1, c2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue