From 7c525480d928e9791fc6e358a4b190b77c6181b1 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Tue, 23 Jun 2020 18:34:59 +0200 Subject: Fehlerbehandlung beim Schreiben hinzugefügt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- csv.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'csv.c') diff --git a/csv.c b/csv.c index 3e3bd94..740dcb1 100644 --- a/csv.c +++ b/csv.c @@ -462,6 +462,10 @@ csv_write_field(FILE *out, const char *field, const csv_options_t * const csv_op putc(DELIM, out); } + + if ( ferror(out) ) { + csv_fatal_error(CSV_ERR_IO_WRITE, csv_options); + } } void @@ -484,6 +488,10 @@ csv_write(FILE *out, const csv_t * const csv) } } fprintf(out, "\r\n"); + + if ( ferror(out) ) { + csv_fatal_error(CSV_ERR_IO_WRITE, csv_options); + } } void @@ -510,5 +518,9 @@ csv_write_ex(FILE *out, int n, const char *fields[], const csv_options_t * csv_o } } fprintf(out, "\r\n"); + + if ( ferror(out) ) { + csv_fatal_error(CSV_ERR_IO_WRITE, csv_options); + } } -- cgit v1.3