diff options
| author | Thomas Schmucker <ts@its1.de> | 2020-06-23 18:34:59 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2020-06-23 18:34:59 +0200 |
| commit | 7c525480d928e9791fc6e358a4b190b77c6181b1 (patch) | |
| tree | 36a48ebe38683a6febe88abcbe9468e72c86982f /csv.c | |
| parent | 582f0fa86d876d53b1779f02c16f9182300a8975 (diff) | |
| download | libcsv-7c525480d928e9791fc6e358a4b190b77c6181b1.tar.gz libcsv-7c525480d928e9791fc6e358a4b190b77c6181b1.tar.bz2 libcsv-7c525480d928e9791fc6e358a4b190b77c6181b1.zip | |
Fehlerbehandlung beim Schreiben hinzugefügt
Diffstat (limited to 'csv.c')
| -rw-r--r-- | csv.c | 12 |
1 files changed, 12 insertions, 0 deletions
| @@ -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 | ||
| 467 | void | 471 | void |
| @@ -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 | ||
| 489 | void | 497 | void |
| @@ -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 | ||
