diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-01-03 23:49:59 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-01-03 23:49:59 +0100 |
commit | d52aacd2b245a61f5e3c361599442f70f0abce23 (patch) | |
tree | fd2798c59f885f4f75c05401747c4e59b1ffd0f1 /FICS | |
parent | 7e6efb47ced5f8142122dad277a71201c11c956c (diff) |
Null check fgets()
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/comproc.c | 4 |
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); |