Patches from Ben Hutchings to fix failures of sscanf error checking.

[originally from svn r6147]
This commit is contained in:
Simon Tatham
2005-07-29 11:24:55 +00:00
parent 19c9453b5c
commit 178a86197b
2 changed files with 2 additions and 2 deletions

2
pegs.c
View File

@ -869,7 +869,7 @@ static game_state *execute_move(game_state *state, char *move)
int sx, sy, tx, ty;
game_state *ret;
if (sscanf(move, "%d,%d-%d,%d", &sx, &sy, &tx, &ty)) {
if (sscanf(move, "%d,%d-%d,%d", &sx, &sy, &tx, &ty) == 4) {
int mx, my, dx, dy;
if (sx < 0 || sx >= w || sy < 0 || sy >= h)