mirror of
https://github.com/zint/zint
synced 2024-11-16 20:57:25 +13:00
- 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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user