From 0bde6ae5b4bbec3cac12c828fbeb13c2147ae093 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Wed, 1 May 2024 14:32:35 +0200 Subject: Replaced unsafe sprintf() calls --- FICS/command.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'FICS') diff --git a/FICS/command.c b/FICS/command.c index 80462da..a2d61f9 100644 --- a/FICS/command.c +++ b/FICS/command.c @@ -727,7 +727,8 @@ check_news(int p, int admin) time_t lc = player_lastconnect(p); if (admin) { - sprintf(filename, "%s/newadminnews.index", news_dir); + msnprintf(filename, sizeof filename, "%s/newadminnews.index", + news_dir); if ((fp = fopen(filename, "r")) == NULL) { fprintf(stderr, "Can't find admin news index.\n"); @@ -763,7 +764,8 @@ check_news(int p, int admin) "admin news file)\n", num_anews); } } else { - sprintf(filename, "%s/newnews.index", news_dir); + msnprintf(filename, sizeof filename, "%s/newnews.index", + news_dir); if ((fp = fopen(filename, "r")) == NULL) { fprintf(stderr, "Can't find news index.\n"); -- cgit v1.2.3