X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=loa-board.c;h=8ea6f99d36bb45ad758011bee975ef57faf3c86a;hb=HEAD;hp=5eb9cc5ab4984b87a8b050e06a8b20c2ada3b0c3;hpb=8a4f047dec04d825e2074113a7c8f1ba3c602889;p=loa 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; }