Menu: Error checking for strings.lst parsing, as some mods (The Ship) can't

do access out-of-bounds string indices.
This commit is contained in:
Marco Cawthorne 2019-09-03 10:41:13 +02:00
parent 22763a61ff
commit d577f378e2
1 changed files with 6 additions and 2 deletions

View File

@ -577,9 +577,13 @@ void Strings_Init(void)
if (stringslst >= 0) {
int lc;
while((lstline = fgets(stringslst))) {
lc = tokenize(lstline);
lc = tokenize_console(lstline);
if (lc == 2) {
m_reslbl[stof(argv(0))] = argv(1);
float i = stof(argv(0));
/* you never know the vile stuff mods do. */
if (i < m_reslbl.length) {
m_reslbl[stof(argv(0))] = argv(1);
}
}
}
fclose(stringslst);