From: jacob Date: Mon, 4 Jul 2005 11:21:50 +0000 (+0000) Subject: Fix bounds checking for Flip cursor control. X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/puzzles/commitdiff_plain/8d6149b6779c8c8c19eacde479d05712cd3209da Fix bounds checking for Flip cursor control. git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6050 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/flip.c b/flip.c index f1fcaf6..503681e 100644 --- a/flip.c +++ b/flip.c @@ -928,8 +928,8 @@ static char *interpret_move(game_state *state, game_ui *ui, game_drawstate *ds, default: assert(!"shouldn't get here"); } ui->cx += dx; ui->cy += dy; - ui->cx = min(max(ui->cx, 0), state->w); - ui->cy = min(max(ui->cy, 0), state->h); + ui->cx = min(max(ui->cx, 0), state->w - 1); + ui->cy = min(max(ui->cy, 0), state->h - 1); ui->cdraw = 1; nullret = ""; }