shithub: puzzles

Download patch

ref: 9e2e0692ed087dbe0d5f4abbddf3aebd6a11b30e
parent: 5cc9bfb811854b66c4a570e8100b8a1aad037f0e
author: Ben Harris <bjh21@bjh21.me.uk>
date: Mon Jan 9 19:22:57 EST 2023

Also check for tiny grids in Mines

A zero-size grid isn't acceptable even if someone has generated it for
us.

--- a/mines.c
+++ b/mines.c
@@ -261,6 +261,8 @@
      */
     if (full && params->unique && (params->w <= 2 || params->h <= 2))
 	return "Width and height must both be greater than two";
+    if (params->w < 1 || params->h < 1)
+	return "Width and height must both be at least one";
     if (params->w > INT_MAX / params->h)
         return "Width times height must not be unreasonably large";
     if (params->n < 0)