From 700d6e0c5ae656db02d1fa52a9f892f0f180fdda Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Thu, 4 Jan 2024 00:12:00 +0100 Subject: Check the return of sscanf() --- FICS/comproc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'FICS/comproc.c') diff --git a/FICS/comproc.c b/FICS/comproc.c index 5bd1eba..c48c068 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -113,12 +113,10 @@ rscan_news2(FILE *fp, int p, int num) if (num == 0) return; - ; - - if (fgets(junk, sizeof junk, fp) == NULL || feof(fp)) + if (fgets(junk, sizeof junk, fp) == NULL || feof(fp) || + sscanf(junk, "%ld %9s", &lval, count) != 2) return; - sscanf(junk, "%ld %s", &lval, count); rscan_news2(fp, p, num - 1); junkp = junk; -- cgit v1.2.3