diff options
Diffstat (limited to 'engines/wintermute/base/base_quick_msg.cpp')
-rw-r--r-- | engines/wintermute/base/base_quick_msg.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/engines/wintermute/base/base_quick_msg.cpp b/engines/wintermute/base/base_quick_msg.cpp index 0a9907ac6b..50a9031eee 100644 --- a/engines/wintermute/base/base_quick_msg.cpp +++ b/engines/wintermute/base/base_quick_msg.cpp @@ -32,26 +32,20 @@ namespace Wintermute { ////////////////////////////////////////////////////////////////////////// -BaseQuickMsg::BaseQuickMsg(BaseGame *inGame, const char *text) : BaseClass(inGame) { - _text = new char [strlen(text) + 1]; - if (_text) { - strcpy(_text, text); - } +BaseQuickMsg::BaseQuickMsg(BaseGame *inGame, const char *text) { + _text = text; _startTime = _gameRef->_currentTime; } ////////////////////////////////////////////////////////////////////////// BaseQuickMsg::~BaseQuickMsg() { - if (_text) { - delete[] _text; - } } ////////////////////////////////////////////////////////////////////////// -char *BaseQuickMsg::getText() { - return _text; +const char *BaseQuickMsg::getText() const { + return _text.c_str(); } } // end of namespace Wintermute |