aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/comproc.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2024-01-03 23:13:53 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2024-01-03 23:13:53 +0100
commit0bf817b4bbd20c7333231a8c90c6d58c6c5e2f11 (patch)
tree93ee6d35d00af5624f20a74a3dd11347a5bda68a /FICS/comproc.c
parent4e934bee5c0b162d76f1a5883909d162c7faf05e (diff)
Reformatted com_stats_rating()
Diffstat (limited to 'FICS/comproc.c')
-rw-r--r--FICS/comproc.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/FICS/comproc.c b/FICS/comproc.c
index c4abad7..154e366 100644
--- a/FICS/comproc.c
+++ b/FICS/comproc.c
@@ -318,20 +318,28 @@ PRIVATE void com_stats_andify(int *numbers, int howmany, char *dest)
return;
}
-PRIVATE void com_stats_rating(char *hdr, statistics * stats, char *dest)
+PRIVATE void
+com_stats_rating(char *hdr, statistics *stats, char *dest)
{
- char tmp[100];
+ char tmp[100] = { '\0' };
- sprintf(dest, "%-10s%4s %5.1f %4d %4d %4d %4d",
- hdr, ratstr(stats->rating), stats->sterr, stats->win, stats->los, stats->dra, stats->num);
- if (stats->whenbest) {
- sprintf(tmp, " %d", stats->best);
- strcat(dest, tmp);
- strftime(tmp, sizeof(tmp), " (%d-%b-%y)", localtime((time_t *) & stats->whenbest));
- strcat(dest, tmp);
- }
- strcat(dest, "\n");
- return;
+ sprintf(dest, "%-10s%4s %5.1f %4d %4d %4d %4d", hdr,
+ ratstr(stats->rating),
+ stats->sterr,
+ stats->win,
+ stats->los,
+ stats->dra,
+ stats->num);
+
+ if (stats->whenbest) {
+ sprintf(tmp, " %d", stats->best);
+ strcat(dest, tmp);
+ strftime(tmp, sizeof tmp, " (%d-%b-%y)",
+ localtime((time_t *) &stats->whenbest));
+ strcat(dest, tmp);
+ }
+
+ strcat(dest, "\n");
}
PUBLIC int