mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 16:05:44 -07:00
Fix a memory error in Guess cursor handling.
This commit is contained in:

committed by
Simon Tatham

parent
ea8da331e3
commit
5cb91f28ba
2
guess.c
2
guess.c
@ -777,6 +777,8 @@ static char *interpret_move(const game_state *from, game_ui *ui,
|
|||||||
set_peg(&from->params, ui, ui->peg_cur, 0);
|
set_peg(&from->params, ui, ui->peg_cur, 0);
|
||||||
ret = "";
|
ret = "";
|
||||||
} else if (button == 'H' || button == 'h') {
|
} else if (button == 'H' || button == 'h') {
|
||||||
|
if (ui->peg_cur == from->params.npegs)
|
||||||
|
return NULL;
|
||||||
ui->display_cur = 1;
|
ui->display_cur = 1;
|
||||||
ui->holds[ui->peg_cur] = 1 - ui->holds[ui->peg_cur];
|
ui->holds[ui->peg_cur] = 1 - ui->holds[ui->peg_cur];
|
||||||
ret = "";
|
ret = "";
|
||||||
|
Reference in New Issue
Block a user