From 2d139b5a28a9e65d60e44c46790828991960586a Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 2 Dec 2024 13:02:05 +0100 Subject: RemoveHistGame: changed while loop --- FICS/gamedb.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/FICS/gamedb.c b/FICS/gamedb.c index 3b6d025..bf9dfbe 100644 --- a/FICS/gamedb.c +++ b/FICS/gamedb.c @@ -1641,12 +1641,8 @@ RemoveHistGame(char *file, int maxlines) count++; - while (!feof(fp)) { - fgets(line, ARRAY_SIZE(line), fp); - - if (!feof(fp)) - count++; - } + while (fgets(line, ARRAY_SIZE(line), fp) != NULL) + count++; fclose(fp); stolower(Opponent); -- cgit v1.2.3