aboutsummaryrefslogtreecommitdiff
path: root/pegs.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2005-07-29 11:24:55 +0000
committerSimon Tatham <anakin@pobox.com>2005-07-29 11:24:55 +0000
commit178a86197b8b769bac35a7032313572551614a4d (patch)
treee2fdf3f25ea7e389a2fa2eee7bebe23e3c4c9af7 /pegs.c
parent19c9453b5c4a1ee0afaf9b85d2c107b70c627cd0 (diff)
downloadpuzzles-178a86197b8b769bac35a7032313572551614a4d.zip
puzzles-178a86197b8b769bac35a7032313572551614a4d.tar.gz
puzzles-178a86197b8b769bac35a7032313572551614a4d.tar.bz2
puzzles-178a86197b8b769bac35a7032313572551614a4d.tar.xz
Patches from Ben Hutchings to fix failures of sscanf error checking.
[originally from svn r6147]
Diffstat (limited to 'pegs.c')
-rw-r--r--pegs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pegs.c b/pegs.c
index 5bb5de2..4abe116 100644
--- a/pegs.c
+++ b/pegs.c
@@ -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)