aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/comproc.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-01-04 00:17:49 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-01-04 00:17:49 +0100
commite8713b07f87ef967c16c5971c3d72daea506baa4 (patch)
tree735a6e117117a88e116c21b567e9788ca857ad6e /FICS/comproc.c
parent700d6e0c5ae656db02d1fa52a9f892f0f180fdda (diff)
Null check fgets()
Diffstat (limited to 'FICS/comproc.c')
-rw-r--r--FICS/comproc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c
index c48c068..539a60d 100644
--- a/FICS/comproc.c
+++ b/FICS/comproc.c
@@ -191,9 +191,8 @@ com_news(int p, param_list param)
while (!feof(fp) && !found) {
junkp = junk;
- fgets(junk, MAX_LINE_SIZE, fp);
- if (feof(fp))
+ if (fgets(junk, sizeof junk, fp) == NULL || feof(fp))
break;
sscanf(junkp, "%ld %s", &lval, count);