Add some braces to a loop in parse_opts().

A for loop had no braces around its body, which was a single if-else
statement.  In Advanced Rogue 5, another statement had been added,
accidentally removing the if-else from the loop.  This could have
resulted in an out-of-bounds access to the options array.

In the other games, the added braces are only for clarity.
This commit is contained in:
John "Elwin" Edwards 2017-02-10 09:02:58 -05:00
parent 62047972cc
commit 7eeb9ddcb6
3 changed files with 6 additions and 0 deletions

View file

@ -350,6 +350,7 @@ parse_opts(char *str)
* Look it up and deal with it
*/
for (op = optlist; op <= &optlist[NUM_OPTS-1]; op++)
{
if (EQSTR(str, op->o_name, len))
{
if (op->o_putfunc == put_bool) /* if option is a boolean */
@ -412,6 +413,7 @@ parse_opts(char *str)
*(bool *)op->o_opt = FALSE;
break;
}
}
/*
* skip to start of next option name