From 664878f5991244cbf41749ae07d858968156efa7 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Thu, 25 Jun 2020 08:27:49 +0200 Subject: 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. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- csv.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'csv.c') 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) if ( idx < 0 || idx >= csv->csv_field.pos ) { csv_fatal_error(CSV_ERR_OUT_OF_RANGE, csv->csv_options); + return NULL; } return &csv->csv_string.str[csv->csv_field.fields[idx]]; @@ -275,6 +276,7 @@ csv_read(csv_t *csv, FILE *in) if ( ferror(in) ) { csv_fatal_error(CSV_ERR_IO_READ, csv->csv_options); + return -1; } // do not try to read if EOF has already been seen @@ -406,6 +408,7 @@ csv_read(csv_t *csv, FILE *in) case STATE_END_FILE: if ( ferror(in) ) { csv_fatal_error(CSV_ERR_IO_READ, csv->csv_options); + return -1; } if ( csv_string_empty(&csv->csv_string) ) { -- cgit v1.3