From 92644d6b212f3835051c4ebe8fa86ccd1b7756f4 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Mon, 2 Dec 2024 15:22:03 +0100 Subject: LoadMsgs: changed the while loop --- FICS/playerdb.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/FICS/playerdb.c b/FICS/playerdb.c index 2ac7389..7cc577c 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -2546,12 +2546,7 @@ LoadMsgs(int p, int which, textlist **Head) if ((fp = fopen(fName, "r")) == NULL) return -1; - while (!feof(fp)) { - fgets(line, sizeof line, fp); - - if (feof(fp)) - break; - + while (fgets(line, sizeof line, fp) != NULL) { if (SaveThisMsg(which, line)) { SaveTextListEntry(Cur, line, ++n); Cur = &(*Cur)->next; -- cgit v1.2.3