From cf47d8972fcb685c3542dc768c3ee70fe5bcba04 Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 24 Dec 2023 00:07:30 +0100 Subject: Reformatted append_holding_machine() --- FICS/board.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/FICS/board.c b/FICS/board.c index c65ee19..2a123cb 100644 --- a/FICS/board.c +++ b/FICS/board.c @@ -148,20 +148,23 @@ PRIVATE char *holding_str(int *holding) return tmp; } -PRIVATE char *append_holding_machine(char *buf, int g, int c, int p) +PRIVATE char * +append_holding_machine(char *buf, int g, int c, int p) { - game_state_t *gs = &garray[g].game_state; - char tmp[50]; - - sprintf(tmp, " game %d white [%s] black [", g+1, holding_str(gs->holding[0])); - strcat(tmp, holding_str(gs->holding[1])); - strcat(buf, tmp); - if (p) { - sprintf(tmp, "] <- %c%s\n", "WB"[c], wpstring[p]); - strcat(buf, tmp); - } else - strcat(buf, "]\n"); - return buf; + char tmp[50]; + game_state_t *gs = &garray[g].game_state; + + sprintf(tmp, " game %d white [%s] black [", (g + 1), + holding_str(gs->holding[0])); + strcat(tmp, holding_str(gs->holding[1])); + strcat(buf, tmp); + + if (p) { + sprintf(tmp, "] <- %c%s\n", "WB"[c], wpstring[p]); + strcat(buf, tmp); + } else + strcat(buf, "]\n"); + return buf; } PRIVATE char * -- cgit v1.2.3