aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/ratings.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2026-03-11 19:46:42 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2026-03-11 19:46:42 +0100
commit77146bbcc00ab66e20160cb61c6a10ddc1b3f40a (patch)
treea6153228ecbf63d1be0f3892de9e838a8df069ae /FICS/ratings.c
parent91dffdeb1a2c992a65a45a1953ade3a116c36fcc (diff)
UpdateRank: log fprintf() errors
Diffstat (limited to 'FICS/ratings.c')
-rw-r--r--FICS/ratings.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/FICS/ratings.c b/FICS/ratings.c
index c59dd5a..27ebcac 100644
--- a/FICS/ratings.c
+++ b/FICS/ratings.c
@@ -1552,6 +1552,7 @@ UpdateRank(int type, char *addName, statistics *sNew, char *delName)
char login[MAX_LOGIN_NAME] = { '\0' };
int comp = 0;
int fd = -1;
+ int ret = -1;
statistics sCur = {
.sterr = 0.0,
.num = 0,
@@ -1612,20 +1613,24 @@ UpdateRank(int type, char *addName, statistics *sNew, char *delName)
int computer = in_list(-1, L_COMPUTER, addName);
if (sNew) {
- fprintf(fptemp, "%s %d %d %d\n", addName,
+ ret = fprintf(fptemp, "%s %d %d %d\n", addName,
sNew->rating, sNew->num, computer);
} else {
warnx("%s: 'sNew' null: addName = %s", __func__,
addName);
- fprintf(fptemp, "%s %d %d %d\n", addName,
+ ret = fprintf(fptemp, "%s %d %d %d\n", addName,
0, 0, computer);
}
+ if (ret < 0)
+ warnx("%s: error: fprintf", __func__);
addName = NULL;
}
- fprintf(fptemp, "%s %d %d %d\n", login, sCur.rating, sCur.num,
- comp);
+ ret = fprintf(fptemp, "%s %d %d %d\n",
+ login, sCur.rating, sCur.num, comp);
+ if (ret < 0)
+ warnx("%s: error: fprintf", __func__);
}
if (fclose(fptemp) != 0 ||