WME: Fix bug #6531 - "WME: Art of Murder - Assertion"

This commit is contained in:
Filippos Karapetis 2014-02-18 10:50:06 +02:00
parent b06497f351
commit 5d0ebad996

View File

@ -298,7 +298,9 @@ bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
uint32 start = 0;
for(uint32 i = 0; i < str.size() + 1; i++) {
uint32 ch = str[i];
// The [] operator doesn't allow access to the zero code terminator
// (bug #6531)
uint32 ch = (i == str.size()) ? '\0' : str[i];
if (ch =='\0' || delims.contains(ch)) {
if (i != start) {
parts.push_back(WideString(str.c_str() + start, i - start + 1));