From dbc6e45a10e0b77398198f06527959dc51b47020 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 30 Jun 2005 08:25:47 +0000 Subject: [PATCH] Attempting to begin a drag from (i.e. just click on) the hint pegs for a past guess caused strangeness up to and including segfault, thanks to bad bounds checking. Well spotted John Sullivan. git-svn-id: svn://svn.tartarus.org/sgt/puzzles@6040 cda61777-01e9-0310-a592-d414129be87e --- guess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guess.c b/guess.c index bf7a148..12d8b1b 100644 --- a/guess.c +++ b/guess.c @@ -637,7 +637,7 @@ static char *interpret_move(game_state *from, game_ui *ui, game_drawstate *ds, } else { over_hint = 1; } - } else if (x >= guess_ox && + } else if (x >= guess_ox && x <= (guess_ox + GUESS_W) && y >= GUESS_OY && y < guess_oy) { over_past_guess_y = (y - GUESS_OY) / PEGOFF; over_past_guess_x = (x - guess_ox) / PEGOFF; -- 2.11.0