aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
Diffstat (limited to 'FICS')
-rw-r--r--FICS/ratings.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/FICS/ratings.c b/FICS/ratings.c
index 07c8262..9b46cfd 100644
--- a/FICS/ratings.c
+++ b/FICS/ratings.c
@@ -358,12 +358,21 @@ load_ratings(void)
&lHist[i]);
errno_save = errno;
if (ret != 4) {
- if (feof(fp) || ferror(fp))
- break;
errno = errno_save;
- warn("%s: too few items assigned (iteration: %d)",
+ warnx("%s: too few items assigned (iteration: %d)",
__func__, i);
+ fclose(fp);
+ return;
}
+
+ if (feof(fp) || ferror(fp))
+ break;
+ }
+
+ if (ferror(fp)) {
+ warnx("%s: %s: the error indicator is set", __func__, fname);
+ fclose(fp);
+ return;
}
fclose(fp);