mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-18 17:25:09 -04:00
Add text_length
(length of text
) to zint_symbol
, and new
`BARCODE_PLAIN_HRT` option for `output_options` - for use primarily by ZXing-C++ but may be generally useful; centralize setting of HRT using new common `hrt_cpy_nochk()` etc. routines to ensure `text_length` always set PLESSEY: add show default check characters option CODE32: ignore `option_2` (check digit options) PZN: ignore `option_2` (check digit options) except when indicates PZN7 only DPD: exclude DEL from ident tag also out_maybe_mkdir: fix `utf8_to_wide()` return (Windows only) general: replace use of `strcpy()` etc. (except for test suite) with `memcpy()`, `hrt_()` etc. in lib & `cpy_str()` etc. in CLI & `cpy_bytearray_left()` in backend_qt clang-tidy: update README reflecting above backend_tcl: use sizeof(primary) to check length; tabs -> spaces general: various code fiddling docs: pandoc 3.6.2 -> 3.6.3
This commit is contained in:
parent
ddedd00d2d
commit
fef8b083b4
82 changed files with 2873 additions and 1671 deletions
|
@ -53,7 +53,7 @@ static void svg_pick_colour(const int colour, char colour_code[7]) {
|
|||
"000000", /* 6: Black (7) */
|
||||
"ffffff", /* 7: White (8) */
|
||||
};
|
||||
strcpy(colour_code, rgbs[idx]);
|
||||
memcpy(colour_code, rgbs[idx], 7); /* Include terminating NUL */
|
||||
}
|
||||
|
||||
/* Convert text to use HTML entity codes */
|
||||
|
@ -62,27 +62,27 @@ static void svg_make_html_friendly(const unsigned char *string, char *html_versi
|
|||
for (; *string; string++) {
|
||||
switch (*string) {
|
||||
case '>':
|
||||
strcpy(html_version, ">");
|
||||
memcpy(html_version, ">", 4);
|
||||
html_version += 4;
|
||||
break;
|
||||
|
||||
case '<':
|
||||
strcpy(html_version, "<");
|
||||
memcpy(html_version, "<", 4);
|
||||
html_version += 4;
|
||||
break;
|
||||
|
||||
case '&':
|
||||
strcpy(html_version, "&");
|
||||
memcpy(html_version, "&", 5);
|
||||
html_version += 5;
|
||||
break;
|
||||
|
||||
case '"':
|
||||
strcpy(html_version, """);
|
||||
memcpy(html_version, """, 6);
|
||||
html_version += 6;
|
||||
break;
|
||||
|
||||
case '\'':
|
||||
strcpy(html_version, "'");
|
||||
memcpy(html_version, "'", 6);
|
||||
html_version += 6;
|
||||
break;
|
||||
|
||||
|
@ -133,7 +133,7 @@ INTERNAL int svg_plot(struct zint_symbol *symbol) {
|
|||
struct zint_vector_string *string;
|
||||
|
||||
char colour_code[7];
|
||||
int len, html_len;
|
||||
int html_len;
|
||||
|
||||
const int upcean = is_upcean(symbol->symbology);
|
||||
char *html_string;
|
||||
|
@ -149,10 +149,9 @@ INTERNAL int svg_plot(struct zint_symbol *symbol) {
|
|||
}
|
||||
sprintf(bgcolour_string, "%02X%02X%02X", bgred, bggreen, bgblue);
|
||||
|
||||
len = (int) ustrlen(symbol->text);
|
||||
html_len = len + 1;
|
||||
html_len = symbol->text_length + 1;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
for (i = 0; i < symbol->text_length; i++) {
|
||||
switch (symbol->text[i]) {
|
||||
case '>':
|
||||
case '<':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue