top: add another tiny bit of robustness to rcfile code

At this point I don't know if the Rc.id ever carried a
value of 'b', 'c', 'd' or 'e' in a public release. But
I do know that those values ought not to be recognized
in any configuration file. Now they won't be for sure.

[ while the absence of this new check didn't produce ]
[ an error message, it would skip the initialization ]
[ of default values plus possible string extensions. ]

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner 2022-03-15 00:00:00 -05:00 committed by Craig Small
parent a03a09ae1e
commit edc5efcac2

View File

@ -4048,6 +4048,8 @@ static const char *configs_file (FILE *fp, const char *name, float *delay) {
}
if (Rc.id < 'a' || Rc.id > RCF_VERSION_ID)
return p;
if (strchr("bcde", Rc.id))
return p;
if (Rc.mode_altscr < 0 || Rc.mode_altscr > 1)
return p;
if (Rc.mode_irixps < 0 || Rc.mode_irixps > 1)