diff options
Diffstat (limited to 'FICS')
-rw-r--r-- | FICS/comproc.c | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c index 7f2a992..20385c3 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -684,24 +684,30 @@ plogins(int p, char *fname) return COM_OK; } -PUBLIC int com_llogons(int p, param_list param) +PUBLIC int +com_llogons(int p, param_list param) { - char fname[MAX_FILENAME_SIZE]; + char fname[MAX_FILENAME_SIZE] = { '\0' }; - sprintf(fname, "%s/%s", stats_dir, STATS_LOGONS); - return plogins(p, fname); + snprintf(fname, sizeof fname, "%s/%s", stats_dir, STATS_LOGONS); + return plogins(p, fname); } -PUBLIC int com_logons(int p, param_list param) +PUBLIC int +com_logons(int p, param_list param) { - char fname[MAX_FILENAME_SIZE]; + char fname[MAX_FILENAME_SIZE] = { '\0' }; - if (param[0].type == TYPE_WORD) { - sprintf(fname, "%s/player_data/%c/%s.%s", stats_dir, param[0].val.word[0], param[0].val.word, STATS_LOGONS); - } else { - sprintf(fname, "%s/player_data/%c/%s.%s", stats_dir, parray[p].login[0], parray[p].login, STATS_LOGONS); - } - return plogins(p, fname); + if (param[0].type == TYPE_WORD) { + snprintf(fname, sizeof fname, "%s/player_data/%c/%s.%s", + stats_dir, param[0].val.word[0], param[0].val.word, + STATS_LOGONS); + } else { + snprintf(fname, sizeof fname, "%s/player_data/%c/%s.%s", + stats_dir, parray[p].login[0], parray[p].login, + STATS_LOGONS); + } + return plogins(p, fname); } PRIVATE void |