From bfd9efe4c1fb2df08e716b4d6b3f54689fc0bc08 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Thu, 2 May 2024 22:47:01 +0200 Subject: Revised game_delete() --- FICS/gamedb.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'FICS/gamedb.c') diff --git a/FICS/gamedb.c b/FICS/gamedb.c index c4becc7..765f361 100644 --- a/FICS/gamedb.c +++ b/FICS/gamedb.c @@ -1157,18 +1157,20 @@ PUBLIC int game_read(int g, int wp, int bp) return 0; } -PUBLIC int game_delete(int wp, int bp) +PUBLIC int +game_delete(int wp, int bp) { - char fname[MAX_FILENAME_SIZE]; - char lname[MAX_FILENAME_SIZE]; + char fname[MAX_FILENAME_SIZE]; + char lname[MAX_FILENAME_SIZE]; - sprintf(fname, "%s/%c/%s-%s", adj_dir, parray[wp].login[0], - parray[wp].login, parray[bp].login); - sprintf(lname, "%s/%c/%s-%s", adj_dir, parray[bp].login[0], - parray[wp].login, parray[bp].login); - unlink(fname); - unlink(lname); - return 0; + msnprintf(fname, sizeof fname, "%s/%c/%s-%s", adj_dir, + parray[wp].login[0], parray[wp].login, parray[bp].login); + msnprintf(lname, sizeof lname, "%s/%c/%s-%s", adj_dir, + parray[bp].login[0], parray[wp].login, parray[bp].login); + + unlink(fname); + unlink(lname); + return 0; } void -- cgit v1.2.3