aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/eco.c
diff options
context:
space:
mode:
Diffstat (limited to 'FICS/eco.c')
-rw-r--r--FICS/eco.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/FICS/eco.c b/FICS/eco.c
index d7943c0..7bcc83f 100644
--- a/FICS/eco.c
+++ b/FICS/eco.c
@@ -154,9 +154,9 @@ ECO_init(void)
(void) strlcat(FENpos, onMove, sizeof FENpos);
(void) strlcpy(ptmp, "", sizeof tmp);
- fgets(ptmp, sizeof tmp, fp);
- if (feof(fp))
- continue;
+ if (fgets(ptmp, sizeof tmp, fp) == NULL ||
+ feof(fp))
+ break;
sscanf(ptmp, "%[0-z]", ECO);
if ((ECO_book[i] = malloc(sizeof(ECO_entry))) == NULL)
@@ -213,9 +213,9 @@ NIC_init(void)
(void) strlcat(FENpos, onMove, sizeof FENpos);
(void) strlcpy(ptmp, "", sizeof tmp);
- fgets(ptmp, sizeof tmp, fp);
- if (feof(fp))
- continue;
+ if (fgets(ptmp, sizeof tmp, fp) == NULL ||
+ feof(fp))
+ break;
sscanf(ptmp, "%[.-z]", NIC);
if ((NIC_book[i] = malloc(sizeof(NIC_entry))) == NULL)
@@ -266,9 +266,9 @@ LONG_init(void)
(void) strlcat(FENpos, onMove, sizeof FENpos);
(void) strlcpy(ptmp, "", sizeof tmp);
- fgets(ptmp, sizeof tmp, fp);
- if (feof(fp))
- continue;
+ if (fgets(ptmp, sizeof tmp, fp) == NULL ||
+ feof(fp))
+ break;
sscanf(ptmp, "%[^*\n]", LONG);
if ((LONG_book[i] = malloc(sizeof(LONG_entry))) == NULL)