aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2025-04-06 19:34:49 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2025-04-06 19:34:49 +0200
commitd6dd8a695e7f85727271e135a4d37f8fa037ece7 (patch)
treeb76dd164b8a571da3a033d7a374d2c5817c240e0 /FICS
parentc27b25f652a3895a674b9bc7120cf4e3edf869f8 (diff)
Fixed Clang Tidy warnings
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);