chiark / gitweb /
Handle the space bar in the Javascript front end.
[sgt-puzzles.git] / solo.c
diff --git a/solo.c b/solo.c
index e8752adb34205958b9ae534c70681b7b59864e9d..789d68fd86afeeb0bcbc1fb6e04d6a34d6328de8 100644 (file)
--- a/solo.c
+++ b/solo.c
@@ -3840,7 +3840,7 @@ static char *spec_to_dsf(const char **pdesc, int **pdsf, int cr, int area)
        }
        desc++;
 
-       adv = (c != 25);               /* 'z' is a special case */
+       adv = (c != 26);               /* 'z' is a special case */
 
        while (c-- > 0) {
            int p0, p1;
@@ -3849,7 +3849,11 @@ static char *spec_to_dsf(const char **pdesc, int **pdsf, int cr, int area)
             * Non-edge; merge the two dsf classes on either
             * side of it.
             */
-           assert(pos < 2*cr*(cr-1));
+           if (pos >= 2*cr*(cr-1)) {
+                sfree(dsf);
+                return "Too much data in block structure specification";
+            }
+
            if (pos < cr*(cr-1)) {
                int y = pos/(cr-1);
                int x = pos%(cr-1);