From 0b265b5d8cf04c0d0f8b9d6e1bd613527d45f699 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Thu, 28 Nov 2024 06:48:13 +0100 Subject: ShowRankLines: more null checks --- FICS/ratings.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FICS/ratings.c b/FICS/ratings.c index ca05908..c0f5264 100644 --- a/FICS/ratings.c +++ b/FICS/ratings.c @@ -1736,15 +1736,15 @@ ShowRankLines(int p, FILE *fb, FILE *fs, FILE *fw, int bCount, int sCount, DisplayRankHead(p, show); for (int i = 0; i < n && show; i++) { - if (CheckFlag(show, SHOW_BLITZ)) { + if (fb != NULL && CheckFlag(show, SHOW_BLITZ)) { bCount += ShowRankEntry(p, fb, bCount, showComp, target, &lastBlitz, &nTiedBlitz); } - if (CheckFlag(show, SHOW_STANDARD)) { + if (fs != NULL && CheckFlag(show, SHOW_STANDARD)) { sCount += ShowRankEntry(p, fs, sCount, showComp, target, &lastStd, &nTiedStd); } - if (CheckFlag(show, SHOW_WILD)) { + if (fw != NULL && CheckFlag(show, SHOW_WILD)) { wCount += ShowRankEntry(p, fw, wCount, showComp, target, &lastWild, &nTiedWild); } -- cgit v1.2.3