aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-19 11:41:20 +0000
committerMartin Kiewitz2010-07-19 11:41:20 +0000
commit07009b045e35133b0a398ecc0d78316ed2e01d09 (patch)
treec435c2ec6b63c8fc3e0902e0f97339a1ef71b928
parent42107e2f5c09d9b25419ea8e2710502ca94b88a4 (diff)
downloadscummvm-rg350-07009b045e35133b0a398ecc0d78316ed2e01d09.tar.gz
scummvm-rg350-07009b045e35133b0a398ecc0d78316ed2e01d09.tar.bz2
scummvm-rg350-07009b045e35133b0a398ecc0d78316ed2e01d09.zip
SCI: fix parser crash on >=0x80 chars
svn-id: r51025
-rw-r--r--engines/sci/parser/vocabulary.cpp4
1 files 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