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
This commit is contained in:
Jamieson Christian 2003-07-14 10:02:37 +00:00
parent dc9a153e1b
commit 4ae380102a

View File

@ -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;