diff options
author | Markus Uhlin <markus@nifty-networks.net> | 2024-01-03 23:15:46 +0100 |
---|---|---|
committer | Markus Uhlin <markus@nifty-networks.net> | 2024-01-03 23:15:46 +0100 |
commit | ee2505ddaa4e2d056f9532a1b550dac14b67c02f (patch) | |
tree | 06715c4d5c7c9fbd8473eb58ea367a45c5c56557 /FICS/comproc.c | |
parent | 0bf817b4bbd20c7333231a8c90c6d58c6c5e2f11 (diff) |
Reformatted com_stats_andify()
Diffstat (limited to 'FICS/comproc.c')
-rw-r--r-- | FICS/comproc.c | 35 |
1 files changed, 19 insertions, 16 deletions
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 |