diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-05-18 17:25:30 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-05-18 17:25:30 +0000 |
| commit | 981b831c21fb21d9ab04abf6a3bf330aa7a14dc5 (patch) | |
| tree | c99b33425251c8d350242b2e6df27b566b2c231a | |
| parent | 90e42d4cdedf999a5c996ff4ac1353ecee280ea5 (diff) | |
| download | puzzles-981b831c21fb21d9ab04abf6a3bf330aa7a14dc5.zip puzzles-981b831c21fb21d9ab04abf6a3bf330aa7a14dc5.tar.gz puzzles-981b831c21fb21d9ab04abf6a3bf330aa7a14dc5.tar.bz2 puzzles-981b831c21fb21d9ab04abf6a3bf330aa7a14dc5.tar.xz | |
It's a good idea to validate presets received from the environment.
[originally from svn r5805]
| -rw-r--r-- | midend.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -585,6 +585,12 @@ int midend_num_presets(midend_data *me) preset = me->ourgame->default_params(); me->ourgame->decode_params(preset, val); + if (me->ourgame->validate_params(preset)) { + /* Drop this one from the list. */ + me->ourgame->free_params(preset); + continue; + } + if (me->presetsize <= me->npresets) { me->presetsize = me->npresets + 10; me->presets = sresize(me->presets, me->presetsize, |