aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/comproc.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-01-03 23:49:59 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-01-03 23:49:59 +0100
commitd52aacd2b245a61f5e3c361599442f70f0abce23 (patch)
treefd2798c59f885f4f75c05401747c4e59b1ffd0f1 /FICS/comproc.c
parent7e6efb47ced5f8142122dad277a71201c11c956c (diff)
Null check fgets()
Diffstat (limited to 'FICS/comproc.c')
-rw-r--r--FICS/comproc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c
index 399ccc8..220bc3d 100644
--- a/FICS/comproc.c
+++ b/FICS/comproc.c
@@ -113,9 +113,9 @@ rscan_news2(FILE *fp, int p, int num)
if (num == 0)
return;
- fgets(junk, MAX_LINE_SIZE, fp);
+ ;
- if (feof(fp))
+ if (fgets(junk, sizeof junk, fp) == NULL || feof(fp))
return;
sscanf(junk, "%ld %s", &lval, count);