From dd195e8cc04a8fce04b478966f264cb2e39c2dfe Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 24 Dec 2023 00:18:07 +0100 Subject: Reformatted board_init() --- FICS/board.c | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/FICS/board.c b/FICS/board.c index f41c411..ca2f5fa 100644 --- a/FICS/board.c +++ b/FICS/board.c @@ -92,22 +92,28 @@ PRIVATE int orient; PRIVATE int forPlayer; PRIVATE int myTurn; -PUBLIC int board_init(game_state_t *b, char *category, char *board) +PUBLIC int +board_init(game_state_t *b, char *category, char *board) { - int retval; - int wval; - - if (!category || !board || !category[0] || !board[0]) - retval = board_read_file("standard", "standard", b); - else { - if (!strcmp(category, "wild")) { - if (sscanf(board, "%d", &wval) == 1 && wval >= 1 && wval <= 4) - wild_update(wval); - } - retval = board_read_file(category, board, b); - } - b->gameNum = -1; - return retval; + int retval; + int wval; + + if (category == NULL || board == NULL || + !category[0] || !board[0]) { + retval = board_read_file("standard", "standard", b); + } else { + if (!strcmp(category, "wild")) { + if (sscanf(board, "%d", &wval) == 1 && + wval >= 1 && + wval <= 4) + wild_update(wval); + } + + retval = board_read_file(category, board, b); + } + + b->gameNum = -1; + return retval; } PUBLIC void -- cgit v1.2.3