aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2026-03-11 14:05:30 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2026-03-11 14:05:30 +0100
commit788ad9b57d9c10c73cc1fff1d3a3cf06095a5227 (patch)
tree8e14670931298ab3a741f81abda06439faabff5d /FICS
parent6e0a3f03e7ae5d8155861f64cc4d10df56d9a199 (diff)
DisplayRankedPlayers: check the return value of GetRankFileName()
Diffstat (limited to 'FICS')
-rw-r--r--FICS/ratings.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/FICS/ratings.c b/FICS/ratings.c
index 05cd0b4..f69546b 100644
--- a/FICS/ratings.c
+++ b/FICS/ratings.c
@@ -1976,21 +1976,18 @@ DisplayRankedPlayers(int p, int start, int end, int show, int showComp)
num = 100;
if (CheckFlag(show, SHOW_BLITZ)) {
- GetRankFileName(Path, sizeof Path, TYPE_BLITZ);
-
- if ((fb = fopen(Path, "r")) == NULL)
+ if (GetRankFileName(Path, sizeof Path, TYPE_BLITZ) >= 0 &&
+ (fb = fopen(Path, "r")) == NULL)
ClearFlag(show, SHOW_BLITZ);
}
if (CheckFlag(show, SHOW_STANDARD)) {
- GetRankFileName(Path, sizeof Path, TYPE_STAND);
-
- if ((fs = fopen(Path, "r")) == NULL)
+ if (GetRankFileName(Path, sizeof Path, TYPE_STAND) >= 0 &&
+ (fs = fopen(Path, "r")) == NULL)
ClearFlag(show, SHOW_STANDARD);
}
if (CheckFlag(show, SHOW_WILD)) {
- GetRankFileName(Path, sizeof Path, TYPE_WILD);
-
- if ((fw = fopen(Path, "r")) == NULL)
+ if (GetRankFileName(Path, sizeof Path, TYPE_WILD) >= 0 &&
+ (fw = fopen(Path, "r")) == NULL)
ClearFlag(show, SHOW_WILD);
}