From 07009b045e35133b0a398ecc0d78316ed2e01d09 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Mon, 19 Jul 2010 11:41:20 +0000 Subject: SCI: fix parser crash on >=0x80 chars svn-id: r51025 --- engines/sci/parser/vocabulary.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/sci/parser/vocabulary.cpp b/engines/sci/parser/vocabulary.cpp index 0b57d40686..22827a6327 100644 --- a/engines/sci/parser/vocabulary.cpp +++ b/engines/sci/parser/vocabulary.cpp @@ -376,7 +376,7 @@ void Vocabulary::decipherSaidBlock(byte *addr) { bool Vocabulary::tokenizeString(ResultWordList &retval, const char *sentence, char **error) { const char *lastword = sentence; int pos_in_sentence = 0; - char c; + unsigned char c; int wordlen = 0; *error = NULL; @@ -385,7 +385,7 @@ bool Vocabulary::tokenizeString(ResultWordList &retval, const char *sentence, ch c = sentence[pos_in_sentence++]; - if (isalnum(c) || (c == '-' && wordlen)) + if (isalnum(c) || (c == '-' && wordlen) || (c >= 0x80)) ++wordlen; // Continue on this word */ // Words may contain a '-', but may not -- cgit v1.2.3