forked from len0rd/rockbox
puzzles: add more parameter validation checks
Fixes some annoying crashes. Change-Id: If3c293bd90e301c3e697d1e5fcb1b0aa2ea320fb
This commit is contained in:
parent
c78ff7f615
commit
f31a400bac
7 changed files with 15 additions and 2 deletions
|
@ -179,6 +179,8 @@ static char *validate_params(const game_params *params, int full)
|
|||
{
|
||||
if (params->w <= 0 || params->h <= 0)
|
||||
return "Width and height must both be greater than zero";
|
||||
if (params->w * params->w < 2)
|
||||
return "Grid must contain at least two squares";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue