mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Also check for tiny grids in Mines
A zero-size grid isn't acceptable even if someone has generated it for us.
This commit is contained in:
2
mines.c
2
mines.c
@ -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))
|
if (full && params->unique && (params->w <= 2 || params->h <= 2))
|
||||||
return "Width and height must both be greater than two";
|
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)
|
if (params->w > INT_MAX / params->h)
|
||||||
return "Width times height must not be unreasonably large";
|
return "Width times height must not be unreasonably large";
|
||||||
if (params->n < 0)
|
if (params->n < 0)
|
||||||
|
Reference in New Issue
Block a user