diff options
author | Lars Skovlund | 2011-10-30 13:54:55 +0100 |
---|---|---|
committer | Lars Skovlund | 2011-10-30 13:56:37 +0100 |
commit | 40e22d9e33f2f4e09cabc2bc14805c9b51141b90 (patch) | |
tree | ae68576e7749110da8f97131bb0d1fe96686cebd /engines/sci/engine | |
parent | e20626dfa8f94b9fccbf8599581ca5205870a1c0 (diff) | |
download | scummvm-rg350-40e22d9e33f2f4e09cabc2bc14805c9b51141b90.tar.gz scummvm-rg350-40e22d9e33f2f4e09cabc2bc14805c9b51141b90.tar.bz2 scummvm-rg350-40e22d9e33f2f4e09cabc2bc14805c9b51141b90.zip |
SCI32: kString: Move variable declaration to prevent problems
with object lifetimes.
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kstring.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 1a9359bb26..5ae18c1367 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -697,13 +697,15 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) { case 6: { // Cpy const char *string2 = 0; uint32 string2Size = 0; + Common::String string; if (argv[3].segment == s->_segMan->getStringSegmentId()) { - SciString *string = s->_segMan->lookupString(argv[3]); - string2 = string->getRawData(); - string2Size = string->getSize(); + SciString *sstr; + sstr = s->_segMan->lookupString(argv[3]); + string2 = sstr->getRawData(); + string2Size = sstr->getSize(); } else { - Common::String string = s->_segMan->getString(argv[3]); + string = s->_segMan->getString(argv[3]); string2 = string.c_str(); string2Size = string.size() + 1; } |