summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schmucker <ts@its1.de>2020-06-25 08:27:49 +0200
committerThomas Schmucker <ts@its1.de>2020-06-25 08:27:49 +0200
commit664878f5991244cbf41749ae07d858968156efa7 (patch)
treefcc5cc65afefce4f7d775a93f56a0dcecbccc1ec
parentfe58b1eeeb6cb14c0d225f2c87f203cc29626267 (diff)
downloadlibcsv-664878f5991244cbf41749ae07d858968156efa7.tar.gz
libcsv-664878f5991244cbf41749ae07d858968156efa7.tar.bz2
libcsv-664878f5991244cbf41749ae07d858968156efa7.zip
Füge nach jedem csv_fatal_error() eine return-Anweisung hinzu. Diese
wird normalerweise nicht ausgeführt, da csv_fatal_error() mit abort() das Programm beendet, aber einige Compiler wissen das nicht und geben dann eine (sinnlose) Warnung aus. Dieser Fix soll diese Warnung verhindern.
-rw-r--r--csv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/csv.c b/csv.c
index 87c33b4..0f743c9 100644
--- a/csv.c
+++ b/csv.c
@@ -257,6 +257,7 @@ csv_field(const csv_t * const csv, int idx)
257 257
258 if ( idx < 0 || idx >= csv->csv_field.pos ) { 258 if ( idx < 0 || idx >= csv->csv_field.pos ) {
259 csv_fatal_error(CSV_ERR_OUT_OF_RANGE, csv->csv_options); 259 csv_fatal_error(CSV_ERR_OUT_OF_RANGE, csv->csv_options);
260 return NULL;
260 } 261 }
261 262
262 return &csv->csv_string.str[csv->csv_field.fields[idx]]; 263 return &csv->csv_string.str[csv->csv_field.fields[idx]];
@@ -275,6 +276,7 @@ csv_read(csv_t *csv, FILE *in)
275 276
276 if ( ferror(in) ) { 277 if ( ferror(in) ) {
277 csv_fatal_error(CSV_ERR_IO_READ, csv->csv_options); 278 csv_fatal_error(CSV_ERR_IO_READ, csv->csv_options);
279 return -1;
278 } 280 }
279 281
280 // do not try to read if EOF has already been seen 282 // do not try to read if EOF has already been seen
@@ -406,6 +408,7 @@ csv_read(csv_t *csv, FILE *in)
406 case STATE_END_FILE: 408 case STATE_END_FILE:
407 if ( ferror(in) ) { 409 if ( ferror(in) ) {
408 csv_fatal_error(CSV_ERR_IO_READ, csv->csv_options); 410 csv_fatal_error(CSV_ERR_IO_READ, csv->csv_options);
411 return -1;
409 } 412 }
410 413
411 if ( csv_string_empty(&csv->csv_string) ) { 414 if ( csv_string_empty(&csv->csv_string) ) {