Do a bounds check before calling functions defined in cctype

This commit is contained in:
Evil Eye 2021-11-10 21:25:16 +01:00
parent c01ba41aa6
commit 751e8cf76b
9 changed files with 44 additions and 37 deletions

View file

@ -172,8 +172,7 @@ namespace Interpreter{
for(unsigned int j = 0; j < globals.size(); j++){
if(globals[j].length() > temp.length()){ // Just in case there's a global with a huuuge name
temp = text.substr(i+1, globals[j].length());
transform(temp.begin(), temp.end(), temp.begin(), ::tolower);
temp = Misc::StringUtils::lowerCase(text.substr(i+1, globals[j].length()));
}
found = check(temp, globals[j], &i, &start);