chiark
/
gitweb
/
~ian
/
sgt-puzzles.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
466c398
)
Add a couple of missing checks in validate_desc(), without which
author
Simon Tatham
<anakin@pobox.com>
Wed, 16 Sep 2009 12:57:07 +0000
(12:57 +0000)
committer
Simon Tatham
<anakin@pobox.com>
Wed, 16 Sep 2009 12:57:07 +0000
(12:57 +0000)
bogus game IDs were getting as far as new_game() and failing
assertions.
[originally from svn r8655]
tents.c
patch
|
blob
|
history
diff --git
a/tents.c
b/tents.c
index 134d44ba93ad81c60bb57084db3b006556fe72f9..2c8b042a6dd4bc657000841752113bdf96057553 100644
(file)
--- a/
tents.c
+++ b/
tents.c
@@
-1210,6
+1210,10
@@
static char *validate_desc(game_params *params, char *desc)
desc++;
}
+ if (area < w * h + 1)
+ return "Not enough data to fill grid";
+ else if (area > w * h + 1)
+ return "Too much data to fill grid";
for (i = 0; i < w+h; i++) {
if (!*desc)