diff options
author | D G Turner | 2017-01-12 09:46:14 +0000 |
---|---|---|
committer | D G Turner | 2017-01-12 09:46:14 +0000 |
commit | 72dbd12811aac2929638b13a5f90d07a51977343 (patch) | |
tree | 3a7778c8ba8fbf285300a9e0accfceef28084f9a /gui | |
parent | adbf18abca0d6a43830645ab0d8ce492bbbd4971 (diff) | |
download | scummvm-rg350-72dbd12811aac2929638b13a5f90d07a51977343.tar.gz scummvm-rg350-72dbd12811aac2929638b13a5f90d07a51977343.tar.bz2 scummvm-rg350-72dbd12811aac2929638b13a5f90d07a51977343.zip |
GUI: Replace sprintf() with safer String::format() in KeysDialog.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/KeysDialog.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gui/KeysDialog.cpp b/gui/KeysDialog.cpp index 7adb20a379..fcf9201877 100644 --- a/gui/KeysDialog.cpp +++ b/gui/KeysDialog.cpp @@ -68,7 +68,7 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { case kListSelectionChangedCmd: if (_actionsList->getSelected() >= 0) { - char selection[100]; + Common::String selection; uint16 key = Actions::Instance()->getMapping(_actionsList->getSelected()); #ifdef __SYMBIAN32__ @@ -77,9 +77,9 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { key = key - Common::ASCII_F1 + SDLK_F1; #endif if (key != 0) - sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey)key)); + selection = Common::String::format(_("Associated key : %s"), SDL_GetKeyName((SDLKey)key)); else - sprintf(selection, _("Associated key : none")); + selection = Common::String::format(_("Associated key : none")); _keyMapping->setLabel(selection); _keyMapping->draw(); @@ -89,7 +89,7 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { if (_actionsList->getSelected() < 0) { _actionTitle->setLabel(_("Please select an action")); } else { - char selection[100]; + Common::String selection; _actionSelected = _actionsList->getSelected(); uint16 key = Actions::Instance()->getMapping(_actionSelected); @@ -99,9 +99,9 @@ void KeysDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { key = key - Common::ASCII_F1 + SDLK_F1; #endif if (key != 0) - sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey)key)); + selection = Common::String::format(_("Associated key : %s"), SDL_GetKeyName((SDLKey)key)); else - sprintf(selection, _("Associated key : none")); + selection = Common::String::format(_("Associated key : none")); _actionTitle->setLabel(_("Press the key to associate")); _keyMapping->setLabel(selection); @@ -133,14 +133,14 @@ void KeysDialog::handleKeyUp(Common::KeyState state) { #else if (state.flags == 0xff && Actions::Instance()->mappingActive()) { // GAPI key was selected #endif - char selection[100]; + Common::String selection; Actions::Instance()->setMapping((ActionType)_actionSelected, state.ascii); if (state.ascii != 0) - sprintf(selection, _("Associated key : %s"), SDL_GetKeyName((SDLKey) state.keycode)); + selection = Common::String::format(_("Associated key : %s"), SDL_GetKeyName((SDLKey) state.keycode)); else - sprintf(selection, _("Associated key : none")); + selection = Common::String::format(_("Associated key : none")); _actionTitle->setLabel(_("Choose an action to map")); _keyMapping->setLabel(selection); |