aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/ratings.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2025-10-04 13:55:04 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2025-10-04 13:55:04 +0200
commit7a3fd562cb80da8881a5cebeab0641fcb7b2af30 (patch)
tree6361222b350e98e2c2c22c5c649c0fcb7b60ec85 /FICS/ratings.c
parent85b030a13a3c802c2d8e9d064e7c8665c2a0c54a (diff)
Refer to the array indices by using enums
Diffstat (limited to 'FICS/ratings.c')
-rw-r--r--FICS/ratings.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/FICS/ratings.c b/FICS/ratings.c
index a85776d..8113c6d 100644
--- a/FICS/ratings.c
+++ b/FICS/ratings.c
@@ -418,10 +418,7 @@ save_ratings(void)
snprintf(fname, sizeof fname, "%s/newratingsV%d_data", stats_dir,
STATS_VERSION);
- errno = 0;
- fd = open(fname, g_open_flags[1], g_open_modes);
-
- if (fd < 0) {
+ if ((fd = open(fname, g_open_flags[OPFL_WRITE], g_open_modes)) < 0) {
warn("%s: can't write ratings data", __func__);
return;
} else if ((fp = fdopen(fd, "w")) == NULL) {
@@ -1501,10 +1498,8 @@ UpdateRank(int type, char *addName, statistics *sNew, char *delName)
snprintf(TmpRankFile, sizeof TmpRankFile, "%s/tmpRank", sdir);
- errno = 0;
- fd = open(TmpRankFile, g_open_flags[1], g_open_modes);
-
- if (fd < 0) {
+ if ((fd = open(TmpRankFile, g_open_flags[OPFL_WRITE],
+ g_open_modes)) < 0) {
warn("%s: open", __func__);
fclose(fp);
return;