Fix the loop of validLanguage iterating too much.

This commit is contained in:
Username404-59 2021-04-26 13:05:30 +02:00
parent 75fd1d93d4
commit 697af646d3
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ pair<LANGUAGE, bool> validLanguage(const string& it) {
static const string_view languages[3] = {".lua", ".js", ".py"}; static const string_view languages[3] = {".lua", ".js", ".py"};
LANGUAGE selected = LUA; LANGUAGE selected = LUA;
bool valid = false; bool valid = false;
for (unsigned short i = 0; (i < languages->size()); ++i) { for (unsigned short i = 0; (i <= (languages->size() - 2)); ++i) {
if (it == languages[i]) { if (it == languages[i]) {
selected = static_cast<LANGUAGE>(i); selected = static_cast<LANGUAGE>(i);
valid = true; valid = true;