aboutsummaryrefslogtreecommitdiff
path: root/twiddle.c
diff options
context:
space:
mode:
authorFranklin Wei <franklin@rockbox.org>2024-07-21 18:54:43 -0400
committerSimon Tatham <anakin@pobox.com>2024-07-31 23:29:00 +0100
commitaf3ab1cc5dae69917f921c959e1105491fecdab7 (patch)
treeaf6cf8f09d5c443772534a6b2c369fb378c3c2ef /twiddle.c
parenta2f7f962ced158dbceebbfc0c3dfbbc58b119e55 (diff)
downloadpuzzles-af3ab1cc5dae69917f921c959e1105491fecdab7.zip
puzzles-af3ab1cc5dae69917f921c959e1105491fecdab7.tar.gz
puzzles-af3ab1cc5dae69917f921c959e1105491fecdab7.tar.bz2
puzzles-af3ab1cc5dae69917f921c959e1105491fecdab7.tar.xz
Add more configuration parameter lower-bound checks.
Diffstat (limited to 'twiddle.c')
-rw-r--r--twiddle.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/twiddle.c b/twiddle.c
index 9aea4e4..b3aa06f 100644
--- a/twiddle.c
+++ b/twiddle.c
@@ -219,6 +219,8 @@ static const char *validate_params(const game_params *params, bool full)
return "Height must be at least the rotating block size";
if (params->w > INT_MAX / params->h)
return "Width times height must not be unreasonably large";
+ if (params->movetarget < 0)
+ return "Number of shuffling moves may not be negative";
return NULL;
}