aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/comproc.c
diff options
context:
space:
mode:
Diffstat (limited to 'FICS/comproc.c')
-rw-r--r--FICS/comproc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c
index 41b57b3..3323552 100644
--- a/FICS/comproc.c
+++ b/FICS/comproc.c
@@ -168,11 +168,16 @@ com_news(int p, param_list param)
char *junkp = NULL;
const char *v_scan_fmt = "%" SCNd64 " " "%9s";
int found = 0;
+ int ret;
int64_t lval = 0;
time_t crtime = 0;
- snprintf(filename, sizeof filename, "%s/newnews.index", news_dir);
+ ret = snprintf(filename, sizeof filename, "%s/newnews.index", news_dir);
+ if (is_too_long(ret, sizeof filename)) {
+ warnx("%s: fatal: too long filename", __func__);
+ return COM_OK;
+ }
if ((fp = fopen(filename, "r")) == NULL) {
(void) fprintf(stderr, "Can\'t find news index.\n");
return COM_OK;