diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index b564392f..ab6d526b 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -56,9 +56,13 @@ void scriptclass::tokenize( std::string t ) { tempword += currentletter; } + if (j >= (int) SDL_arraysize(words)) + { + break; + } } - if (tempword != "") + if (tempword != "" && j < (int) SDL_arraysize(words)) { words[j] = tempword; }