aboutsummaryrefslogtreecommitdiff
path: root/loopy.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2006-01-05 09:40:51 +0000
committerSimon Tatham <anakin@pobox.com>2006-01-05 09:40:51 +0000
commitac027d9d0876c98d60d0d0e9e3ba3576cb0f41cd (patch)
tree409dc01852e0db389d3c56fd2f5b128d51c9ce9c /loopy.c
parent7c5ff85bb14990cb0c288ed4f0618091433e823b (diff)
downloadpuzzles-ac027d9d0876c98d60d0d0e9e3ba3576cb0f41cd.zip
puzzles-ac027d9d0876c98d60d0d0e9e3ba3576cb0f41cd.tar.gz
puzzles-ac027d9d0876c98d60d0d0e9e3ba3576cb0f41cd.tar.bz2
puzzles-ac027d9d0876c98d60d0d0e9e3ba3576cb0f41cd.tar.xz
Revert a change in an assertion made in r6299. It was right the
first time, and now has a comment explaining why! [originally from svn r6511] [r6299 == c389f623f66fe5296f7ef5c66d88884607b82cff]
Diffstat (limited to 'loopy.c')
-rw-r--r--loopy.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/loopy.c b/loopy.c
index 9f54c8a..f70e5b1 100644
--- a/loopy.c
+++ b/loopy.c
@@ -1210,8 +1210,14 @@ static char *encode_solve_move(const game_state *state)
}
}
- /* No point in doing sums like that if they're going to be wrong */
- assert(strlen(ret) == (size_t)len);
+ /*
+ * Ensure we haven't overrun the buffer we allocated (which we
+ * really shouldn't have, since we computed its maximum size).
+ * Note that this assert is <= rather than ==, because the
+ * solver is permitted to produce an incomplete solution in
+ * which case the buffer will be only partially used.
+ */
+ assert(strlen(ret) <= (size_t)len);
return ret;
}