aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/command.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-05-01 14:32:35 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2024-05-01 14:32:35 +0200
commit0bde6ae5b4bbec3cac12c828fbeb13c2147ae093 (patch)
treeface11f5269342324340c0d6df15e676a56e59ce /FICS/command.c
parent14d078ceb3e21ebf74397fe164706fa0c9497ee5 (diff)
Replaced unsafe sprintf() calls
Diffstat (limited to 'FICS/command.c')
-rw-r--r--FICS/command.c6
1 files changed, 4 insertions, 2 deletions
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");