SCI32: kString: Move variable declaration to prevent problems
with object lifetimes.
This commit is contained in:
parent
e20626dfa8
commit
40e22d9e33
1 changed files with 6 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue