From 94f8c0ca42c9a6354b0f9f51f27c01b72b299d75 Mon Sep 17 00:00:00 2001 From: olemorud Date: Thu, 16 Mar 2023 17:25:45 +0100 Subject: [PATCH] Remove implicit fallthrough --- chess.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chess.c b/chess.c index b3eec4a..c760183 100644 --- a/chess.c +++ b/chess.c @@ -222,6 +222,10 @@ int is_valid(int* board, const int from, const int to, const int player){ printf("attempting to move %lc to %lc\t%i", 0x2659 + board[from], 0x2659 + board[to], movedelta); switch(board[from]){ + default: + return 0; + break; + // PAWNS case P: case -P: switch(movedelta){ @@ -246,7 +250,6 @@ int is_valid(int* board, const int from, const int to, const int player){ } // the remaining pieces are left as an exercise for the reader - default: return 0; } return 0;