From 77ece1c4cac59a535d45f2ffeb6c95c7a1ed3269 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Thu, 28 Nov 2024 07:18:03 +0100 Subject: Changed GetPlayerInfo() --- FICS/makerank.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'FICS/makerank.c') diff --git a/FICS/makerank.c b/FICS/makerank.c index 85938ce..00bac38 100644 --- a/FICS/makerank.c +++ b/FICS/makerank.c @@ -75,6 +75,8 @@ GetPlayerInfo(char *fileName, ENTRY *e) fclose(fp); return 0; } + + done = 1; } else { do { sscanf(line, "%s", field); @@ -111,12 +113,13 @@ GetPlayerInfo(char *fileName, ENTRY *e) done = 1; } - fgets(line, sizeof line, fp); + if (fgets(line, sizeof line, fp) == NULL) + break; } while (!done && !feof(fp)); } fclose(fp); - return 1; + return (done ? 1 : 0); } static int -- cgit v1.2.3