aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/keyboard.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2011-04-24 12:28:22 +0300
committerEugene Sandulenko2011-04-24 12:28:22 +0300
commit52c05acd959bd873306177a39e6c159e67e5f165 (patch)
treec0da78672a688b535020a70c8dfe63e63b267f73 /engines/agi/keyboard.cpp
parentf246382f4b70c75ae8b084d79e64fea237bb5603 (diff)
downloadscummvm-rg350-52c05acd959bd873306177a39e6c159e67e5f165.tar.gz
scummvm-rg350-52c05acd959bd873306177a39e6c159e67e5f165.tar.bz2
scummvm-rg350-52c05acd959bd873306177a39e6c159e67e5f165.zip
AGI: Fix bug #3087825: AGI: Code analysis warnings
Diffstat (limited to 'engines/agi/keyboard.cpp')
-rw-r--r--engines/agi/keyboard.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp
index 344654128d..95211f8e3c 100644
--- a/engines/agi/keyboard.cpp
+++ b/engines/agi/keyboard.cpp
@@ -279,7 +279,7 @@ void AgiEngine::handleGetstring(int key) {
void AgiEngine::handleKeys(int key) {
uint8 *p = NULL;
int c = 0;
- static uint8 formattedEntry[256];
+ static uint8 formattedEntry[40];
int l = _game.lineUserInput;
int fg = _game.colorFg, bg = _game.colorBg;
int promptLength = strlen(agiSprintf(_game.strings[0]));
@@ -298,7 +298,7 @@ void AgiEngine::handleKeys(int key) {
;
// Copy to internal buffer
- for (; *p; p++) {
+ for (; *p && c < 40-1; p++) {
// Squash spaces
if (*p == 0x20 && *(p + 1) == 0x20) {
p++;