From 5c48a594628a98f6edb5ac0fa1f0ea1b14fa27b7 Mon Sep 17 00:00:00 2001 From: Jacob Nevins Date: Mon, 4 Jul 2005 11:21:50 +0000 Subject: [PATCH] Fix bounds checking for Flip cursor control. [originally from svn r6050] --- flip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 = ""; }