shithub: puzzles

Download patch

ref: 4f6e48e6beafd73e052ec2454dc3a69949eee37e
parent: 466c398a00de9b6df3d0846d55089ff419fd25ba
author: Simon Tatham <anakin@pobox.com>
date: Wed Sep 16 08:57:07 EDT 2009

Add a couple of missing checks in validate_desc(), without which
bogus game IDs were getting as far as new_game() and failing
assertions.

[originally from svn r8655]

--- a/tents.c
+++ b/tents.c
@@ -1210,6 +1210,10 @@
 
 	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)