diff options
Diffstat (limited to 'FICS/makerank.c')
-rw-r--r-- | FICS/makerank.c | 7 |
1 files changed, 5 insertions, 2 deletions
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 |