mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 16:03:05 +00:00
LURE: Allocate debug strings buffer on the heap
This commit is contained in:
parent
8a5bda72cc
commit
9ff993382e
@ -549,14 +549,19 @@ bool Debugger::cmd_showAnim(int argc, const char **argv) {
|
||||
}
|
||||
|
||||
bool Debugger::cmd_saveStrings(int argc, const char **argv) {
|
||||
StringData &strings = StringData::getReference();
|
||||
char buffer[32768];
|
||||
|
||||
if (argc != 2) {
|
||||
DebugPrintf("strings <stringId>\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
StringData &strings = StringData::getReference();
|
||||
|
||||
char *buffer = (char *)malloc(32768);
|
||||
if (!buffer) {
|
||||
DebugPrintf("Cannot allocate strings buffer\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
uint16 id = strToInt(argv[1]);
|
||||
strings.getString(id, buffer, NULL, NULL);
|
||||
DebugPrintf("%s\n", buffer);
|
||||
@ -577,6 +582,9 @@ bool Debugger::cmd_saveStrings(int argc, const char **argv) {
|
||||
|
||||
DebugPrintf("Done\n");
|
||||
*/
|
||||
|
||||
free(buffer);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user