diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-01-10 00:22:57 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-01-15 16:24:27 +0000 |
| commit | 9e2e0692ed087dbe0d5f4abbddf3aebd6a11b30e (patch) | |
| tree | 1e03846414c8d85b7dd16fd6039a3dcbfb37e36b /mines.c | |
| parent | 5cc9bfb811854b66c4a570e8100b8a1aad037f0e (diff) | |
| download | puzzles-9e2e0692ed087dbe0d5f4abbddf3aebd6a11b30e.zip puzzles-9e2e0692ed087dbe0d5f4abbddf3aebd6a11b30e.tar.gz puzzles-9e2e0692ed087dbe0d5f4abbddf3aebd6a11b30e.tar.bz2 puzzles-9e2e0692ed087dbe0d5f4abbddf3aebd6a11b30e.tar.xz | |
Also check for tiny grids in Mines
A zero-size grid isn't acceptable even if someone has generated it for
us.
Diffstat (limited to 'mines.c')
| -rw-r--r-- | mines.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -261,6 +261,8 @@ static const char *validate_params(const game_params *params, bool full) */ 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) |