aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2009-01-21 19:46:51 +0000
committerTorbjörn Andersson2009-01-21 19:46:51 +0000
commit248605800e97f75b2c048c4ed4200fa409df57be (patch)
tree08b407d1dcc65dab8b868f9ef5801c2b1200255e
parente94378511e1bf3cc56318341d24776db817bf3e5 (diff)
downloadscummvm-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
-rw-r--r--engines/sword1/control.cpp2
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();