aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2020-06-23 18:34:59 +0200
committerThomas Schmucker <ts@its1.de>2020-06-23 18:34:59 +0200
commit7c525480d928e9791fc6e358a4b190b77c6181b1 (patch)
tree36a48ebe38683a6febe88abcbe9468e72c86982f
parent582f0fa86d876d53b1779f02c16f9182300a8975 (diff)
downloadlibcsv-7c525480d928e9791fc6e358a4b190b77c6181b1.tar.gz
libcsv-7c525480d928e9791fc6e358a4b190b77c6181b1.tar.bz2
libcsv-7c525480d928e9791fc6e358a4b190b77c6181b1.zip
Fehlerbehandlung beim Schreiben hinzugefügt
-rw-r--r--csv.c12
1 files changed, 12 insertions, 0 deletions
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
462 462
463 putc(DELIM, out); 463 putc(DELIM, out);
464 } 464 }
465
466 if ( ferror(out) ) {
467 csv_fatal_error(CSV_ERR_IO_WRITE, csv_options);
468 }
465} 469}
466 470
467void 471void
@@ -484,6 +488,10 @@ csv_write(FILE *out, const csv_t * const csv)
484 } 488 }
485 } 489 }
486 fprintf(out, "\r\n"); 490 fprintf(out, "\r\n");
491
492 if ( ferror(out) ) {
493 csv_fatal_error(CSV_ERR_IO_WRITE, csv_options);
494 }
487} 495}
488 496
489void 497void
@@ -510,5 +518,9 @@ csv_write_ex(FILE *out, int n, const char *fields[], const csv_options_t * csv_o
510 } 518 }
511 } 519 }
512 fprintf(out, "\r\n"); 520 fprintf(out, "\r\n");
521
522 if ( ferror(out) ) {
523 csv_fatal_error(CSV_ERR_IO_WRITE, csv_options);
524 }
513} 525}
514 526