From 3749e5361f0f805b153ab9768e737f2cec150db3 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Wed, 20 Nov 2024 22:25:11 +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 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) -- cgit v1.2.3