option parsing crash: 'playmode' without value

Reported directly to devteam, specifying the playmode option without
appending a value caused a segfault during options parsing.  The
argument passed to string_for_opt() ought to have been False for
"not optional" to trigger a "bad syntax" message, but even then the
playmode parsing needs to check for Null to prevent the crash.

"Bad syntax" is awfully vague.  In cases like this, we can be more
precise.  Now it will say "Missing value" instead.
This commit is contained in:
PatR
2016-08-04 17:42:26 -07:00
parent e03c14eeae
commit 694b32cae2
2 changed files with 28 additions and 21 deletions

View File

@@ -328,6 +328,7 @@ eating the corpse of a unique non-named monster (Wizard of Yendor, Oracle,
Chromatic Dragon, others) gave "The the <monster corpse> tastes ..."
when escaping the dungeon, change "you were here" annotation in dungeon
overview to "you left from here"
option parsing will crash if 'playmode' option is present without a value
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository