mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Also limit Pegs to at least 1x1 even when not doing full validation
This commit is contained in:
2
pegs.c
2
pegs.c
@ -183,6 +183,8 @@ static const char *validate_params(const game_params *params, bool full)
|
|||||||
{
|
{
|
||||||
if (full && (params->w <= 3 || params->h <= 3))
|
if (full && (params->w <= 3 || params->h <= 3))
|
||||||
return "Width and height must both be greater than three";
|
return "Width and height must both be greater than three";
|
||||||
|
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";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user