X-Git-Url: https://git.cworth.org/git?p=loudgame;a=blobdiff_plain;f=loa-board.c;fp=loa-board.c;h=8ea6f99d36bb45ad758011bee975ef57faf3c86a;hp=5eb9cc5ab4984b87a8b050e06a8b20c2ada3b0c3;hb=b61845704f880755cbfc2574ac1b3eca8d237f20;hpb=53f4e9ba973bb1f15f41ba8fdd46ce592eafd9a2 diff --git a/loa-board.c b/loa-board.c index 5eb9cc5..8ea6f99 100644 --- a/loa-board.c +++ b/loa-board.c @@ -186,7 +186,9 @@ loa_board_move_legal (loa_board_t *board, int dx, dy; int step_x, step_y; - if (x1 < 0 || y1 < 0 || x1 >= LOA_BOARD_SIZE || y1 >= LOA_BOARD_SIZE) { + if (x1 < 0 || y1 < 0 || x1 >= LOA_BOARD_SIZE || y1 >= LOA_BOARD_SIZE || + x2 < 0 || y2 < 0 || x2 >= LOA_BOARD_SIZE || y2 >= LOA_BOARD_SIZE) + { *error = "Invalid coordinates (not on board)"; return FALSE; }