From a210ff65a369b3463457470935d4eaf4679b0535 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sun, 3 Jan 2016 00:29:18 +0100 Subject: WAGE; Fix stringOp reading --- engines/wage/script.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'engines/wage') diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp index 13b2617509..0a55360714 100644 --- a/engines/wage/script.cpp +++ b/engines/wage/script.cpp @@ -379,12 +379,14 @@ Script::Operand *Script::readStringOperand() { sb = new String(); - byte c = 0x20; - while (c >= 0x20 && c < 0x80) { - c = _data->readByte(); + while (true) { + byte c = _data->readByte(); if (c < '0' || c > '9') allDigits = false; - *sb += c; + if (c >= 0x20 && c < 0x80) + *sb += c; + else + break; } _data->seek(-1, SEEK_CUR); -- cgit v1.2.3