aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-11-20 22:53:27 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-11-20 22:53:27 +0100
commit3b3652b814a23120d479c745d61086a67117eedd (patch)
tree68e52e300c86393e3b106428f66fccd254f7bb20 /FICS
parent3749e5361f0f805b153ab9768e737f2cec150db3 (diff)
Fixed ignored retvals
Diffstat (limited to 'FICS')
-rw-r--r--FICS/eco.c41
1 files changed, 30 insertions, 11 deletions
diff --git a/FICS/eco.c b/FICS/eco.c
index 7bcc83f..818003c 100644
--- a/FICS/eco.c
+++ b/FICS/eco.c
@@ -148,10 +148,16 @@ ECO_init(void)
feof(fp))
break;
- /* XXX */
- sscanf(ptmp, SCAN_FP_AND_ONMOVE, FENpos, onMove);
- (void) strlcat(FENpos, " ", sizeof FENpos);
- (void) strlcat(FENpos, onMove, sizeof FENpos);
+ if (sscanf(ptmp, SCAN_FP_AND_ONMOVE, FENpos, onMove) != 2) {
+ warnx("%s: sscanf() error (%s:%d)", __func__,
+ filename, i);
+ break;
+ } else if (strlcat(FENpos, " ", sizeof FENpos) >= sizeof FENpos ||
+ strlcat(FENpos, onMove, sizeof FENpos) >= sizeof FENpos) {
+ warnx("%s: strlcat() error (%s:%d)", __func__,
+ filename, i);
+ break;
+ }
(void) strlcpy(ptmp, "", sizeof tmp);
if (fgets(ptmp, sizeof tmp, fp) == NULL ||
@@ -208,9 +214,16 @@ NIC_init(void)
feof(fp))
break;
- sscanf(ptmp, SCAN_FP_AND_ONMOVE, FENpos, onMove);
- (void) strlcat(FENpos, " ", sizeof FENpos);
- (void) strlcat(FENpos, onMove, sizeof FENpos);
+ if (sscanf(ptmp, SCAN_FP_AND_ONMOVE, FENpos, onMove) != 2) {
+ warnx("%s: sscanf() error (%s:%d)", __func__,
+ filename, i);
+ break;
+ } else if (strlcat(FENpos, " ", sizeof FENpos) >= sizeof FENpos ||
+ strlcat(FENpos, onMove, sizeof FENpos) >= sizeof FENpos) {
+ warnx("%s: strlcat() error (%s:%d)", __func__,
+ filename, i);
+ break;
+ }
(void) strlcpy(ptmp, "", sizeof tmp);
if (fgets(ptmp, sizeof tmp, fp) == NULL ||
@@ -260,10 +273,16 @@ LONG_init(void)
feof(fp))
break;
- /* XXX */
- sscanf(ptmp, SCAN_FP_AND_ONMOVE, FENpos, onMove);
- (void) strlcat(FENpos, " ", sizeof FENpos);
- (void) strlcat(FENpos, onMove, sizeof FENpos);
+ if (sscanf(ptmp, SCAN_FP_AND_ONMOVE, FENpos, onMove) != 2) {
+ warnx("%s: sscanf() error (%s:%d)", __func__,
+ filename, i);
+ break;
+ } else if (strlcat(FENpos, " ", sizeof FENpos) >= sizeof FENpos ||
+ strlcat(FENpos, onMove, sizeof FENpos) >= sizeof FENpos) {
+ warnx("%s: strlcat() error (%s:%d)", __func__,
+ filename, i);
+ break;
+ }
(void) strlcpy(ptmp, "", sizeof tmp);
if (fgets(ptmp, sizeof tmp, fp) == NULL ||