- BMP/EMF/EPS/GIF/PCX/PNG/SVG/TIF/TXT: check for errors on writing

to output file; ZBarcode_Encode_File: check `fseek()` for errors
  (ticket #275)
- man page: fix Code 11 check digit info
- manual/man page: document octal escape; Code 128 subset/mode ->
  Code Set
This commit is contained in:
gitlost 2022-12-19 16:28:15 +00:00
parent a54bdc0299
commit 268fdd7fc2
18 changed files with 318 additions and 140 deletions

View file

@ -832,10 +832,24 @@ INTERNAL int emf_plot(struct zint_symbol *symbol, int rotate_angle) {
fwrite(&emr_eof, sizeof(emr_eof_t), 1, emf_file);
if (ferror(emf_file)) {
sprintf(symbol->errtxt, "644: Incomplete write to output (%d: %.30s)", errno, strerror(errno));
if (!output_to_stdout) {
(void) fclose(emf_file);
}
return ZINT_ERROR_FILE_WRITE;
}
if (output_to_stdout) {
fflush(emf_file);
if (fflush(emf_file) != 0) {
sprintf(symbol->errtxt, "940: Incomplete flush to output (%d: %.30s)", errno, strerror(errno));
return ZINT_ERROR_FILE_WRITE;
}
} else {
fclose(emf_file);
if (fclose(emf_file) != 0) {
sprintf(symbol->errtxt, "941: Failure on closing output file (%d: %.30s)", errno, strerror(errno));
return ZINT_ERROR_FILE_WRITE;
}
}
return error_number;
}