aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJamieson Christian2003-07-14 10:02:37 +0000
committerJamieson Christian2003-07-14 10:02:37 +0000
commit4ae380102a533a8a332e46a4daea2a273f3930a1 (patch)
tree027bd0ddca763d271fe72c8bd6ef567be99e7ea0
parentdc9a153e1b7b7dcd82b34a7b63e89855cc7cba3c (diff)
downloadscummvm-rg350-4ae380102a533a8a332e46a4daea2a273f3930a1.tar.gz
scummvm-rg350-4ae380102a533a8a332e46a4daea2a273f3930a1.tar.bz2
scummvm-rg350-4ae380102a533a8a332e46a4daea2a273f3930a1.zip
Fix for Bug [770838] SIMON1DOS: Fatal crashes with French version
Fix variable underflow for large subtitle strings with no discernable whitespace. This fixes crashes for French subtitles that do, in fact, have whitespace but perhaps not using the same ASCII character that we scan for. Anyway, the text will display, albeit with an extra blank line, and ScummVM no longer blows up. svn-id: r9009
-rw-r--r--simon/simon.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 0a5c2ee200..f8c33d00d5 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -4001,7 +4001,7 @@ void SimonEngine::talk_with_text(uint num_1, uint num_2, const char *string_ptr,
while (strlen(string_ptr) > letters_per_row) {
m = letters_per_row;
string_ptr_2 += m;
- while (*string_ptr_2-- != ' ')
+ while (*string_ptr_2-- != ' ' && m)
m--;
string_ptr_2 += 2;
n = (letters_per_row - m + 1) >> 1;