From 34af3b32d9fa576c5c3db34f386876db1fa2f260 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 19 May 2024 22:47:02 +0200 Subject: Replaced the sprintf() calls --- FICS/lists.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'FICS/lists.c') diff --git a/FICS/lists.c b/FICS/lists.c index 5544d9f..5f93baf 100644 --- a/FICS/lists.c +++ b/FICS/lists.c @@ -82,7 +82,8 @@ list_find(int p, enum ListWhich l) char filename[MAX_FILENAME_SIZE] = { '\0' }; char listmember[100] = { '\0' }; - sprintf(filename, "%s/%s", lists_dir, ListArray[l].name); + msnprintf(filename, sizeof filename, "%s/%s", lists_dir, + ListArray[l].name); if ((fp = fopen(filename, "r")) == NULL) { rfree(tempList); @@ -415,7 +416,8 @@ list_addsub(int p, char *list, char *who, int addsub) "by %s.\n", addrem, listname, parray[p].name); } - sprintf(filename, "%s/%s", lists_dir, listname); + msnprintf(filename, sizeof filename, "%s/%s", lists_dir, + listname); if ((fp = fopen(filename, "w")) == NULL) { fprintf(stderr, "Couldn't save %s list.\n", listname); -- cgit v1.2.3