1
0
Fork 0
mirror of https://git.code.sf.net/p/zint/code synced 2025-05-31 15:18:29 -04:00

CMakeLists.txt: cmake min required 3.13 -> 3.5 using CMAKE_REQUIRED_LIBRARIES; add ZINT_COVERAGE option

bmp/emf/ps.c: allow for foreground colour in ULTRA
bmp/gif/pcx.c: allow for BARCODE_STDOUT (fflush/fclose)
emf.c: hexagon rotation field not used; dont't use float index in font loop; Windows stdout binary mode
png.c: remove unused 8-bit; simplify libpng error handling and fclose outfile on error
ps.c: fix buffer overflow on colour_to_pscolor() CMYK
tif.c: fix BLACKISZERO indexes
CODE39: simplify check digit setting
reedsol.c: rs_uint_init_gf() log/alog tables must be zeroed
ZBarcode_Encode: debug: fix access out-of-bounds on non-NUL-terminated source if length < 10
manual.txt/zint.h: document NUL-terminated strings
tests: cover further cases for output (bmp/emf/etc), eci/gb18030/gb2312/sjis, reedsol, AZTEC, CODE39
This commit is contained in:
gitlost 2021-07-26 15:29:05 +01:00
parent 059abdf6a1
commit 3f33ed3eb9
90 changed files with 3754 additions and 863 deletions
backend

View file

@ -259,33 +259,8 @@ INTERNAL int c39(struct zint_symbol *symbol, unsigned char source[], int length)
if (symbol->option_2 == 1) {
char check_digit;
counter = counter % 43;
if (counter < 10) {
check_digit = itoc(counter);
} else {
if (counter < 36) {
check_digit = (counter - 10) + 'A';
} else {
switch (counter) {
case 36: check_digit = '-';
break;
case 37: check_digit = '.';
break;
case 38: check_digit = ' ';
break;
case 39: check_digit = '$';
break;
case 40: check_digit = '/';
break;
case 41: check_digit = '+';
break;
case 42: check_digit = 37;
break;
default: check_digit = ' ';
break; /* Keep compiler happy */
}
}
}
counter %= 43;
check_digit = SILVER[counter];
lookup(SILVER, C39Table, check_digit, dest);
/* Display a space check digit as _, otherwise it looks like an error */
@ -727,7 +702,8 @@ INTERNAL int channel_code(struct zint_symbol *symbol, unsigned char source[], in
if (channels == 8) {
sprintf(symbol->errtxt, "305: Value out of range (0 to %d)", max_ranges[channels]);
} else {
sprintf(symbol->errtxt, "335: Value out of range (0 to %d) for %d channels", max_ranges[channels], channels);
sprintf(symbol->errtxt, "335: Value out of range (0 to %d) for %d channels",
max_ranges[channels], channels);
}
return ZINT_ERROR_INVALID_DATA;
}