diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-01-11 09:35:51 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-01-15 16:24:27 +0000 |
| commit | d60192531e3ee6b492151f6aa8edd481ebddcdf7 (patch) | |
| tree | 561f444f0362b8dbf164949cb518e764cd8ea241 /flood.c | |
| parent | da220a77d1793edd14144fd96584b7f461f06dfb (diff) | |
| download | puzzles-d60192531e3ee6b492151f6aa8edd481ebddcdf7.zip puzzles-d60192531e3ee6b492151f6aa8edd481ebddcdf7.tar.gz puzzles-d60192531e3ee6b492151f6aa8edd481ebddcdf7.tar.bz2 puzzles-d60192531e3ee6b492151f6aa8edd481ebddcdf7.tar.xz | |
Insist that Flood grids must have non-zero size
Diffstat (limited to 'flood.c')
| -rw-r--r-- | flood.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -210,6 +210,8 @@ static const char *validate_params(const game_params *params, bool full) { if (params->w < 2 && params->h < 2) return "Grid must contain at least two squares"; + if (params->w < 1 || params->h < 1) + return "Width and height must be at least one"; if (params->w > INT_MAX / params->h) return "Width times height must not be unreasonably large"; if (params->colours < 3 || params->colours > 10) |