aboutsummaryrefslogtreecommitdiffstats
path: root/FICS
diff options
context:
space:
mode:
Diffstat (limited to 'FICS')
-rw-r--r--FICS/playerdb.c53
1 files changed, 35 insertions, 18 deletions
diff --git a/FICS/playerdb.c b/FICS/playerdb.c
index c3b5c24..6ad941a 100644
--- a/FICS/playerdb.c
+++ b/FICS/playerdb.c
@@ -2348,26 +2348,43 @@ PUBLIC int player_rename(char *name, char *newname)
return 0;
}
-PUBLIC int player_raise(char *name)
+PUBLIC int
+player_raise(char *name)
{
- char fname[MAX_FILENAME_SIZE], fname2[MAX_FILENAME_SIZE];
+ char fname[MAX_FILENAME_SIZE];
+ char fname2[MAX_FILENAME_SIZE];
- sprintf(fname, "%s/%c/%s", player_dir, name[0], name);
- sprintf(fname2, "%s/%c/.rem.%s", player_dir, name[0], name);
- rename(fname2, fname);
- sprintf(fname, "%s/player_data/%c/%s.games", stats_dir, name[0], name);
- sprintf(fname2, "%s/player_data/%c/.rem.%s.games", stats_dir, name[0], name);
- rename(fname2, fname);
- sprintf(fname, "%s/player_data/%c/%s.comments", stats_dir, name[0], name);
- sprintf(fname2, "%s/player_data/%c/.rem.%s.comments", stats_dir, name[0], name);
- rename(fname2, fname);
- sprintf(fname, "%s/player_data/%c/%s.logons", stats_dir, name[0], name);
- sprintf(fname2, "%s/player_data/%c/.rem.%s.logons", stats_dir, name[0], name);
- rename(fname2, fname);
- sprintf(fname, "%s/player_data/%c/%s.messages", stats_dir, name[0], name);
- sprintf(fname2, "%s/player_data/%c/.rem.%s.messages", stats_dir, name[0], name);
- rename(fname2, fname);
- return 0;
+ snprintf(fname, sizeof fname, "%s/%c/%s", player_dir,
+ name[0], name);
+ snprintf(fname2, sizeof fname2, "%s/%c/.rem.%s", player_dir,
+ name[0], name);
+ rename(fname2, fname);
+
+ snprintf(fname, sizeof fname, "%s/player_data/%c/%s.games",
+ stats_dir, name[0], name);
+ snprintf(fname2, sizeof fname2, "%s/player_data/%c/.rem.%s.games",
+ stats_dir, name[0], name);
+ rename(fname2, fname);
+
+ snprintf(fname, sizeof fname, "%s/player_data/%c/%s.comments",
+ stats_dir, name[0], name);
+ snprintf(fname2, sizeof fname2, "%s/player_data/%c/.rem.%s.comments",
+ stats_dir, name[0], name);
+ rename(fname2, fname);
+
+ snprintf(fname, sizeof fname, "%s/player_data/%c/%s.logons",
+ stats_dir, name[0], name);
+ snprintf(fname2, sizeof fname2, "%s/player_data/%c/.rem.%s.logons",
+ stats_dir, name[0], name);
+ rename(fname2, fname);
+
+ snprintf(fname, sizeof fname, "%s/player_data/%c/%s.messages",
+ stats_dir, name[0], name);
+ snprintf(fname2, sizeof fname2, "%s/player_data/%c/.rem.%s.messages",
+ stats_dir, name[0], name);
+ rename(fname2, fname);
+
+ return 0;
}
PUBLIC int