aboutsummaryrefslogtreecommitdiff
path: root/engines/lure
diff options
context:
space:
mode:
authorJulien2011-06-05 06:03:54 +0800
committerJulien2011-06-23 15:11:37 +0800
commit9ff993382e17d1d7aef96105ad5fa2fe35043b7a (patch)
treedb8b4a3e9a4f4639ba9cd0135f9dfc5f34fb5e6a /engines/lure
parent8a5bda72cca58314c639432d5ab718a70fd42b90 (diff)
downloadscummvm-rg350-9ff993382e17d1d7aef96105ad5fa2fe35043b7a.tar.gz
scummvm-rg350-9ff993382e17d1d7aef96105ad5fa2fe35043b7a.tar.bz2
scummvm-rg350-9ff993382e17d1d7aef96105ad5fa2fe35043b7a.zip
LURE: Allocate debug strings buffer on the heap
Diffstat (limited to 'engines/lure')
-rw-r--r--engines/lure/debugger.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/engines/lure/debugger.cpp b/engines/lure/debugger.cpp
index 68410875f7..ef4a22f73a 100644
--- a/engines/lure/debugger.cpp
+++ b/engines/lure/debugger.cpp
@@ -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;
}