From c6e733f87004b0852c0329cfcf92a575e99c72ba Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 31 Dec 2023 17:57:21 +0100 Subject: Reformatted player_delete() --- FICS/playerdb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'FICS') diff --git a/FICS/playerdb.c b/FICS/playerdb.c index fb616ac..d492d79 100644 --- a/FICS/playerdb.c +++ b/FICS/playerdb.c @@ -823,19 +823,19 @@ PUBLIC int player_read(int p, char *name) return 0; } -PUBLIC int player_delete(int p) +PUBLIC int +player_delete(int p) { - char fname[MAX_FILENAME_SIZE]; + char fname[MAX_FILENAME_SIZE]; - if (!parray[p].registered) { /* Player must not be registered */ - return -1; - } -/* if (iamserver) - sprintf(fname, "%s.server/%c/%s", player_dir, parray[p].login[0], parray[p].login); - else */ - sprintf(fname, "%s/%c/%s", player_dir, parray[p].login[0], parray[p].login); - unlink(fname); - return 0; + if (!parray[p].registered) // Player must not be registered + return -1; + + snprintf(fname, sizeof fname, "%s/%c/%s", player_dir, + parray[p].login[0], parray[p].login); + unlink(fname); + + return 0; } PUBLIC int -- cgit v1.2.3