From 63fdfba44a4509947823fc0e10ce3213bbb81b33 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Wed, 20 Nov 2024 22:13:19 +0100 Subject: Fixed ignored retvals --- FICS/eco.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/FICS/eco.c b/FICS/eco.c index 46280aa..9afe4c7 100644 --- a/FICS/eco.c +++ b/FICS/eco.c @@ -141,10 +141,10 @@ ECO_init(void) while (!feof(fp)) { (void) strlcpy(ptmp, "", sizeof tmp); - fgets(ptmp, sizeof tmp, fp); - if (feof(fp)) - continue; + if (fgets(ptmp, sizeof tmp, fp) == NULL || + feof(fp)) + break; /* XXX */ sscanf(ptmp, "%[\x21-z] %s", FENpos, onMove); @@ -201,10 +201,10 @@ NIC_init(void) while (!feof(fp)) { (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, "%[\x21-z] %s", FENpos, onMove); (void) strlcat(FENpos, " ", sizeof FENpos); @@ -253,10 +253,10 @@ LONG_init(void) while (!feof(fp)) { (void) strlcpy(ptmp, "", sizeof tmp); - fgets(ptmp, sizeof tmp, fp); - if (feof(fp)) - continue; + if (fgets(ptmp, sizeof tmp, fp) == NULL || + feof(fp)) + break; /* XXX */ sscanf(ptmp, "%[\x21-z] %s", FENpos, onMove); -- cgit v1.2.3