diff options
author | Martin Kiewitz | 2010-05-31 09:21:15 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-05-31 09:21:15 +0000 |
commit | 7001d3e6157dc9fe601a5f0e2195a367755a344b (patch) | |
tree | 94f4e9cf9c6dcb43c42b9ef030400d3e352c12ce /engines/sci/engine/kstring.cpp | |
parent | 66d4bddb30498419cebf0478a83b77ca3abb8131 (diff) | |
download | scummvm-rg350-7001d3e6157dc9fe601a5f0e2195a367755a344b.tar.gz scummvm-rg350-7001d3e6157dc9fe601a5f0e2195a367755a344b.tar.bz2 scummvm-rg350-7001d3e6157dc9fe601a5f0e2195a367755a344b.zip |
SCI: when getting invalid chars in kReadNumber don't error() out, but create a warning - we get invalid chars in the intro of lsl5, cause currently unknown
svn-id: r49344
Diffstat (limited to 'engines/sci/engine/kstring.cpp')
-rw-r--r-- | engines/sci/engine/kstring.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 13ec1bfc88..69090c4335 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -151,9 +151,13 @@ reg_t kReadNumber(EngineState *s, int argc, reg_t *argv) { source++; } while (*source) { + if ((*source < '0') || (*source > '9')) { + // TODO: this happens in lsl5 right in the intro -> we get '1' '3' 0xCD 0xCD 0xCD 0xCD 0xCD + // find out why this happens and fix it + warning("Invalid character in kReadNumber input"); + break; + } result *= 10; - if ((*source < '0') || (*source > '9')) - error("Invalid character in kReadNumber input"); result += *source - 0x30; source++; } |