diff options
author | Torbjörn Andersson | 2009-01-21 19:46:51 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2009-01-21 19:46:51 +0000 |
commit | 248605800e97f75b2c048c4ed4200fa409df57be (patch) | |
tree | 08b407d1dcc65dab8b868f9ef5801c2b1200255e /engines/sword1/control.cpp | |
parent | e94378511e1bf3cc56318341d24776db817bf3e5 (diff) | |
download | scummvm-rg350-248605800e97f75b2c048c4ed4200fa409df57be.tar.gz scummvm-rg350-248605800e97f75b2c048c4ed4200fa409df57be.tar.bz2 scummvm-rg350-248605800e97f75b2c048c4ed4200fa409df57be.zip |
Don't allow the nul character in savegame names, since that terminates the
string. This happens, for instance, when pressing the Shift key. (I usually start
my savegame names with an upper-case letter, and I couldn't understand why it
didn't seem to register any of my keypresses.)
svn-id: r35986
Diffstat (limited to 'engines/sword1/control.cpp')
-rw-r--r-- | engines/sword1/control.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index eb61ffe4b3..575ff2f0bc 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -697,7 +697,7 @@ void Control::handleSaveKey(Common::KeyState kbd) { uint8 len = _saveNames[_selectedSavegame].size(); if ((kbd.keycode == Common::KEYCODE_BACKSPACE) && len) // backspace _saveNames[_selectedSavegame].deleteLastChar(); - else if (keyAccepted(kbd.ascii) && (len < 31)) { + else if (kbd.ascii && keyAccepted(kbd.ascii) && (len < 31)) { _saveNames[_selectedSavegame].insertChar(kbd.ascii, len); } showSavegameNames(); |