diff options
-rw-r--r-- | engines/macventure/controls.h | 2 | ||||
-rw-r--r-- | engines/macventure/gui.cpp | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/engines/macventure/controls.h b/engines/macventure/controls.h index a780f6328b..574ae6afbe 100644 --- a/engines/macventure/controls.h +++ b/engines/macventure/controls.h @@ -69,7 +69,7 @@ struct ControlData { ControlAction refcon; ControlType type; uint8 titleLength; - char* title; + Common::String title; uint16 border; }; diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp index 834ffc1e19..bf8455eb91 100644 --- a/engines/macventure/gui.cpp +++ b/engines/macventure/gui.cpp @@ -512,9 +512,11 @@ bool Gui::loadControls() { data.type = (ControlType)id; id++; data.titleLength = res->readByte(); if (data.titleLength) { - data.title = new char[data.titleLength + 1]; - res->read(data.title, data.titleLength); - data.title[data.titleLength] = '\0'; + char *title = new char[data.titleLength + 1]; + res->read(title, data.titleLength); + title[data.titleLength] = '\0'; + data.title = Common::String(title); + delete[] title; } if (data.type != kControlExitBox) { BorderBounds bbs = borderBounds(getWindowData(kCommandsWindow).type); |