Mercurial > hg > early-roguelike
diff xrogue/options.c @ 254:e940e6c00751
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.
author | John "Elwin" Edwards |
---|---|
date | Fri, 10 Feb 2017 09:02:58 -0500 |
parents | 50b89f165a34 |
children | e52a8a7ad4c5 |
line wrap: on
line diff
--- a/xrogue/options.c Sat Jan 28 15:49:41 2017 -0500 +++ b/xrogue/options.c Fri Feb 10 09:02:58 2017 -0500 @@ -374,6 +374,7 @@ * Look it up and deal with it */ for (op = optlist; op < &optlist[NUM_OPTS]; op++) + { if (EQSTR(str, op->o_name, len)) { if (op->o_putfunc == put_bool) /* if option is a boolean */ @@ -435,6 +436,7 @@ *(bool *)op->o_opt = FALSE; break; } + } /* * skip to start of next option name