diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-02-15 21:34:27 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-03-30 08:20:21 +0200 |
| commit | 3ce1418ce5141eac6e526dcfb7a824a7731bbe03 (patch) | |
| tree | 7efe33c124ba3502074dd3f05aa08694b98cddf5 /src | |
| parent | c6ac388f8680c8e443f7f3f4b76f9721b0ef6a4c (diff) | |
| download | rts-3ce1418ce5141eac6e526dcfb7a824a7731bbe03.tar.gz | |
container.c: distinguish ferror/feof from other errors
Diffstat (limited to 'src')
| -rw-r--r-- | src/container/src/container.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/container/src/container.c b/src/container/src/container.c index 008ca58..5c568a9 100644 --- a/src/container/src/container.c +++ b/src/container/src/container.c @@ -159,9 +159,15 @@ static int read_all_elements(const struct container *const list, const size_t n, memset(&done, 0, sizeof done); for (size_t i = 0; i < sizeof done / sizeof *done; i++) - if (feof(f) || ferror(f) - || read_element(list, n, f, done)) + { + if (feof(f) || ferror(f)) + { + fprintf(stderr, "feof or ferror found\n"); goto end; + } + else if (read_element(list, n, f, done)) + goto end; + } for (size_t i = 0; i < sizeof done / sizeof *done; i++) { |
