From ee2505ddaa4e2d056f9532a1b550dac14b67c02f Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Wed, 3 Jan 2024 23:15:46 +0100 Subject: Reformatted com_stats_andify() --- FICS/comproc.c | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) (limited to 'FICS') diff --git a/FICS/comproc.c b/FICS/comproc.c index 154e366..425b08b 100644 --- a/FICS/comproc.c +++ b/FICS/comproc.c @@ -299,23 +299,26 @@ FindPlayer(int p, char *name, int *p1, int *connected) return 1; } -PRIVATE void com_stats_andify(int *numbers, int howmany, char *dest) +PRIVATE void +com_stats_andify(int *numbers, int howmany, char *dest) { - char tmp[10]; - - *dest = '\0'; - while (howmany--) { - sprintf(tmp, "%d", numbers[howmany]); - strcat(dest, tmp); - if (howmany > 1) - sprintf(tmp, ", "); - else if (howmany == 1) - sprintf(tmp, " and "); - else - sprintf(tmp, ".\n"); - strcat(dest, tmp); - } - return; + char tmp[10] = { '\0' }; + + *dest = '\0'; + + while (howmany--) { + sprintf(tmp, "%d", numbers[howmany]); + strcat(dest, tmp); + + if (howmany > 1) + sprintf(tmp, ", "); + else if (howmany == 1) + sprintf(tmp, " and "); + else + sprintf(tmp, ".\n"); + + strcat(dest, tmp); + } } PRIVATE void -- cgit v1.2.3