aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-02-15 21:34:27 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-03-30 08:20:21 +0200
commit3ce1418ce5141eac6e526dcfb7a824a7731bbe03 (patch)
tree7efe33c124ba3502074dd3f05aa08694b98cddf5 /src
parentc6ac388f8680c8e443f7f3f4b76f9721b0ef6a4c (diff)
downloadrts-3ce1418ce5141eac6e526dcfb7a824a7731bbe03.tar.gz
container.c: distinguish ferror/feof from other errors
Diffstat (limited to 'src')
-rw-r--r--src/container/src/container.c10
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++)
{