aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/makerank.c
diff options
context:
space:
mode:
Diffstat (limited to 'FICS/makerank.c')
-rw-r--r--FICS/makerank.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/FICS/makerank.c b/FICS/makerank.c
index ca3b65a..aed86fa 100644
--- a/FICS/makerank.c
+++ b/FICS/makerank.c
@@ -137,9 +137,8 @@ LoadEntries(void)
continue;
while (1) {
- fgets(e.name, sizeof(e.name), fpPlayerList);
-
- if (feof(fpPlayerList))
+ if (fgets(e.name, sizeof(e.name), fpPlayerList) == NULL ||
+ feof(fpPlayerList))
break;
len = strlen(e.name);
@@ -194,9 +193,8 @@ SetComputers(int n)
return 0;
while (i < n) {
- fgets(comp, sizeof comp, fpComp);
-
- if (feof(fpComp))
+ if (fgets(comp, sizeof comp, fpComp) == NULL ||
+ feof(fpComp))
break;
comp[strlen(comp) - 1] = '\0';