diff options
author | Martin Kiewitz | 2010-05-31 13:52:07 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-05-31 13:52:07 +0000 |
commit | 753fdd6c123e3be04057ad4e4e35a95a3c39a2b7 (patch) | |
tree | 435920cb6656c00be0d5af257e4a03492c3900f6 /engines/sci | |
parent | b5a2e3c758361e19518f934f99a69056319f5de4 (diff) | |
download | scummvm-rg350-753fdd6c123e3be04057ad4e4e35a95a3c39a2b7.tar.gz scummvm-rg350-753fdd6c123e3be04057ad4e4e35a95a3c39a2b7.tar.bz2 scummvm-rg350-753fdd6c123e3be04057ad4e4e35a95a3c39a2b7.zip |
SCI: break on anything, warn on anything but spaces in kReadNumber
svn-id: r49355
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/kstring.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp index 2ed4dfaac2..2681b612e9 100644 --- a/engines/sci/engine/kstring.cpp +++ b/engines/sci/engine/kstring.cpp @@ -151,16 +151,14 @@ reg_t kReadNumber(EngineState *s, int argc, reg_t *argv) { source++; } while (*source) { - if (*source == ' ') { - source++; // skip spaces - happens in lsl3 intro - // TODO: find the cause for those spaces. ssci breaks when encountering spaces, but we even get a leading - // space in lsl3 (" -97 ") which would actually mean we need to return 0 - continue; - } 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"); + // Sierras atoi stopped processing at anything different than number + // Sometimes the input has a trailing space, that's fine (example: lsl3) + if (*source != ' ') { + // 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; |