diff options
author | Johannes Schickel | 2013-11-23 21:34:54 +0100 |
---|---|---|
committer | Johannes Schickel | 2013-11-23 21:34:54 +0100 |
commit | a6fff7a8054ce84c3482ff7ddc9365fab324200f (patch) | |
tree | 4eda6601ed3fa62c967d2411af65e6f8d6802118 /engines/wintermute/base/scriptables/script_ext_string.cpp | |
parent | 9da09f584679553098c748f2839a617ed1774e83 (diff) | |
download | scummvm-rg350-a6fff7a8054ce84c3482ff7ddc9365fab324200f.tar.gz scummvm-rg350-a6fff7a8054ce84c3482ff7ddc9365fab324200f.tar.bz2 scummvm-rg350-a6fff7a8054ce84c3482ff7ddc9365fab324200f.zip |
WINTERMUTE: Switch WideString to U32String.
Diffstat (limited to 'engines/wintermute/base/scriptables/script_ext_string.cpp')
-rw-r--r-- | engines/wintermute/base/scriptables/script_ext_string.cpp | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/engines/wintermute/base/scriptables/script_ext_string.cpp b/engines/wintermute/base/scriptables/script_ext_string.cpp index b6d284442d..65bec03bc1 100644 --- a/engines/wintermute/base/scriptables/script_ext_string.cpp +++ b/engines/wintermute/base/scriptables/script_ext_string.cpp @@ -298,21 +298,13 @@ bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack uint32 start = 0; for(uint32 i = 0; i < str.size() + 1; i++) { - char ch = str.c_str()[i]; - if(ch=='\0' || delims.contains(ch)) - { - char *part = new char[i - start + 1]; - if(i != start) { - Common::strlcpy(part, str.c_str() + start, i - start + 1); - part[i - start] = '\0'; + uint32 ch = str[i]; + if (ch =='\0' || delims.contains(ch)) { + if (i != start) { + parts.push_back(WideString(str.c_str() + start, i - start + 1)); } else { - part[0] = '\0'; + parts.push_back(WideString()); } - val = new ScValue(_gameRef, part); - array->push(val); - delete[] part; - delete val; - val = nullptr; start = i + 1; } } |