diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-11-20 23:10:11 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-11-20 23:10:11 +0100 |
commit | a9122b90a1ca97ced19ef36a6f417911970eb40c (patch) | |
tree | d42f0b2efe0c1047c98becfc873f6398a4ed1a47 | |
parent | e58006974790a984ce56a951d48d27978ad14791 (diff) |
Fixed ignored retvals
-rw-r--r-- | FICS/eco.c | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -167,7 +167,11 @@ ECO_init(void) if (fgets(ptmp, sizeof tmp, fp) == NULL || feof(fp)) break; - sscanf(ptmp, SCAN_ECO, ECO); + else if (sscanf(ptmp, SCAN_ECO, ECO) != 1) { + warnx("%s: scan eco error (%s:%d)", __func__, + filename, i); + break; + } if ((ECO_book[i] = malloc(sizeof(ECO_entry))) == NULL) err(1, "Cound not alloc mem for ECO entry %d", i); @@ -233,7 +237,11 @@ NIC_init(void) if (fgets(ptmp, sizeof tmp, fp) == NULL || feof(fp)) break; - sscanf(ptmp, SCAN_NIC, NIC); + else if (sscanf(ptmp, SCAN_NIC, NIC) != 1) { + warnx("%s: scan nic error (%s:%d)", __func__, + filename, i); + break; + } if ((NIC_book[i] = malloc(sizeof(NIC_entry))) == NULL) err(1, "Cound not alloc mem for NIC entry %d", i); @@ -292,7 +300,11 @@ LONG_init(void) if (fgets(ptmp, sizeof tmp, fp) == NULL || feof(fp)) break; - sscanf(ptmp, SCAN_LONG, LONG); + else if (sscanf(ptmp, SCAN_LONG, LONG) != 1) { + warnx("%s: scan long error (%s:%d)", __func__, + filename, i); + break; + } if ((LONG_book[i] = malloc(sizeof(LONG_entry))) == NULL) err(1, "Cound not alloc mem for LONG entry %d", i); |