malloc/calloc: check for NULL always (11.1.0 gcc -fanalyzer -c backend/*.c)

ZBarcode_Encode: don't reinit symbol->outfile, props Alonso Schaich
frontend/test_args: skip long filename tests on Windows, props Alonso Schaich
This commit is contained in:
gitlost 2021-06-29 15:43:42 +01:00
parent 8c419ab4fb
commit 368633bda4
9 changed files with 131 additions and 55 deletions

View file

@ -1000,7 +1000,7 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
" in_length: %d, First 10 source: \"%.10s\", First 10 primary: \"%.10s\"\n",
symbol->symbology, symbol->input_mode, symbol->eci, symbol->option_1, symbol->option_2,
symbol->option_3, symbol->scale, symbol->output_options, symbol->fgcolour, symbol->bgcolour,
in_length, source, symbol->primary);
in_length, source ? (const char *) source : "<NULL>", symbol->primary);
}
warn_number = 0;
@ -1021,14 +1021,6 @@ int ZBarcode_Encode(struct zint_symbol *symbol, const unsigned char *source, int
return error_tag(symbol->errtxt, ZINT_ERROR_TOO_LONG);
}
if (*symbol->outfile == '\0') {
#ifdef NO_PNG
strcpy(symbol->outfile, "out.gif");
#else
strcpy(symbol->outfile, "out.png");
#endif
}
/* First check the symbology field */
if (!ZBarcode_ValidID(symbol->symbology)) {
if (symbol->symbology < 1) {