diff options
| author | Markus Uhlin <markus@nifty-networks.net> | 2026-03-09 19:57:34 +0100 |
|---|---|---|
| committer | Markus Uhlin <markus@nifty-networks.net> | 2026-03-09 19:57:34 +0100 |
| commit | 0eb0a61dcc2c1ce9d8ec6bed1c51f28f8762b27b (patch) | |
| tree | a6fde245efc08e3f3050d67c401c027b41d7c087 /FICS/ratings.c | |
| parent | 4284be70e2bb03dba34a111e4c2c63db71d82016 (diff) | |
load_ratings: log fclose() errors
Diffstat (limited to 'FICS/ratings.c')
| -rw-r--r-- | FICS/ratings.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/FICS/ratings.c b/FICS/ratings.c index f02c572..0e7f012 100644 --- a/FICS/ratings.c +++ b/FICS/ratings.c @@ -355,7 +355,10 @@ load_ratings(void) fscanf(fp, "%lf %lf %lf %d", &Rl_M, &Rl_S, &Rl_total, &Rl_count) != 4) { warn("%s: fscanf", __func__); - fclose(fp); + + if (fclose(fp) != 0) + warn("%s: error: fclose", __func__); + return; } @@ -369,18 +372,25 @@ load_ratings(void) if (ret != 4) { warnx("%s: %s: too few items assigned (iteration: %d)", __func__, fname, i); - fclose(fp); + + if (fclose(fp) != 0) + warn("%s: error: fclose", __func__); + return; } } if (ferror(fp)) { warnx("%s: %s: the error indicator is set", __func__, fname); - fclose(fp); + + if (fclose(fp) != 0) + warn("%s: error: fclose", __func__); + return; } - fclose(fp); + if (fclose(fp) != 0) + warn("%s: error: fclose", __func__); if (Rs_count != 0) { Ratings_S_StdDev = sqrt(Rs_S / Rs_count); // NOLINT |
