From 753fdd6c123e3be04057ad4e4e35a95a3c39a2b7 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Mon, 31 May 2010 13:52:07 +0000 Subject: SCI: break on anything, warn on anything but spaces in kReadNumber svn-id: r49355 --- engines/sci/engine/kstring.cpp | 16 +++++++--------- 1 file 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; -- cgit v1.2.3