aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/engine/kstring.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 5ae18c1367..0f79c3592c 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -748,18 +748,21 @@ reg_t kString(EngineState *s, int argc, reg_t *argv) {
const char *rawString = 0;
uint32 size = 0;
reg_t stringHandle;
+ SciString *sciString;
+ Common::String commonString;
+
// We allocate the new string first because if the StringTable needs to
// grow, our rawString pointer will be invalidated
SciString *dupString = s->_segMan->allocateString(&stringHandle);
if (argv[1].segment == s->_segMan->getStringSegmentId()) {
- SciString *string = s->_segMan->lookupString(argv[1]);
- rawString = string->getRawData();
- size = string->getSize();
+ sciString = s->_segMan->lookupString(argv[1]);
+ rawString = sciString->getRawData();
+ size = sciString->getSize();
} else {
- Common::String string = s->_segMan->getString(argv[1]);
- rawString = string.c_str();
- size = string.size() + 1;
+ commonString = s->_segMan->getString(argv[1]);
+ rawString = commonString.c_str();
+ size = commonString.size() + 1;
}
dupString->setSize(size);