From d6a42c0544b127cb6f596c5aa0db5e6370474711 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Thu, 28 Nov 2024 06:33:47 +0100 Subject: ShowRankLines: added null checks --- FICS/ratings.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FICS/ratings.c b/FICS/ratings.c index 438941b..ca05908 100644 --- a/FICS/ratings.c +++ b/FICS/ratings.c @@ -1709,21 +1709,21 @@ ShowRankLines(int p, FILE *fb, FILE *fs, FILE *fw, int bCount, int sCount, if (n <= 0) return 0; - if (CheckFlag(show, SHOW_BLITZ)) { + if (fb != NULL && CheckFlag(show, SHOW_BLITZ)) { PositionFilePtr(fb, bCount, &lastBlitz, &nTiedBlitz, showComp); if (feof(fb)) ClearFlag(show, SHOW_BLITZ); } - if (CheckFlag(show, SHOW_STANDARD)) { + if (fs != NULL && CheckFlag(show, SHOW_STANDARD)) { PositionFilePtr(fs, sCount, &lastStd, &nTiedStd, showComp); if (feof(fs)) ClearFlag(show, SHOW_STANDARD); } - if (CheckFlag(show, SHOW_WILD)) { + if (fw != NULL && CheckFlag(show, SHOW_WILD)) { PositionFilePtr(fw, wCount, &lastWild, &nTiedWild, showComp); if (feof(fw)) -- cgit v1.2.3