diff options
author | Gregory Montoir | 2007-11-01 18:42:22 +0000 |
---|---|---|
committer | Gregory Montoir | 2007-11-01 18:42:22 +0000 |
commit | 36a372ecd1a8c04399cb4ba996ac0bfbb0f907aa (patch) | |
tree | f4e32864b4ee6856f4d634275dd1501fc5fd7632 | |
parent | f1f08ce0086d27fb6e1435f1432ae4d1dcba0388 (diff) | |
download | scummvm-rg350-36a372ecd1a8c04399cb4ba996ac0bfbb0f907aa.tar.gz scummvm-rg350-36a372ecd1a8c04399cb4ba996ac0bfbb0f907aa.tar.bz2 scummvm-rg350-36a372ecd1a8c04399cb4ba996ac0bfbb0f907aa.zip |
fix previous commit
svn-id: r29367
-rw-r--r-- | engines/queen/journal.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/engines/queen/journal.cpp b/engines/queen/journal.cpp index 22d746a4a0..e9f02ff41b 100644 --- a/engines/queen/journal.cpp +++ b/engines/queen/journal.cpp @@ -382,30 +382,31 @@ void Journal::handleMouseDown(int x, int y) { void Journal::drawPanelText(int y, const char *text) { debug(7, "Journal::drawPanelText(%d, '%s')", y, text); - char s[80]; - strncpy(s, text, 79); - s[79] = 0; + char s[128]; + strncpy(s, text, 127); + s[127] = 0; // remove leading and trailing spaces (necessary for spanish version) for (char *p = s + strlen(s) - 1; p >= s && *p == ' '; --p) { *p = 0; } + text = s; for (char *p = s; *p == ' '; ++p) { - *p = 0; + text = p + 1; } // draw the substrings - char *p = strchr(s, ' '); + char *p = strchr(text, ' '); if (!p) { - int x = (128 - _vm->display()->textWidth(s)) / 2; - _vm->display()->setText(x, y, s, false); + int x = (128 - _vm->display()->textWidth(text)) / 2; + _vm->display()->setText(x, y, text, false); assert(_panelTextCount < MAX_PANEL_TEXTS); _panelTextY[_panelTextCount++] = y; } else { *p++ = '\0'; if (_vm->resource()->getLanguage() == Common::HB_ISR) { drawPanelText(y - 5, p); - drawPanelText(y + 5, s); + drawPanelText(y + 5, text); } else { - drawPanelText(y - 5, s); + drawPanelText(y - 5, text); drawPanelText(y + 5, p); } } |