diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/control.cpp | 6 | ||||
-rw-r--r-- | engines/zvision/scr_file_handling.cpp | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/engines/zvision/control.cpp b/engines/zvision/control.cpp index 02d15fe9d0..eeba9b3214 100644 --- a/engines/zvision/control.cpp +++ b/engines/zvision/control.cpp @@ -44,7 +44,7 @@ void Control::parsePanoramaControl(ZVision *engine, Common::SeekableReadStream & Common::String line = stream.readLine(); trimCommentsAndWhiteSpace(&line); - while (!line.contains('}')) { + while (!stream.eos() && !line.contains('}')) { if (line.matchString("angle*", true)) { float fov; sscanf(line.c_str(), "angle(%f)", &fov); @@ -78,7 +78,7 @@ void Control::parseTiltControl(ZVision *engine, Common::SeekableReadStream &stre Common::String line = stream.readLine(); trimCommentsAndWhiteSpace(&line); - while (!line.contains('}')) { + while (!stream.eos() && !line.contains('}')) { if (line.matchString("angle*", true)) { float fov; sscanf(line.c_str(), "angle(%f)", &fov); @@ -110,7 +110,7 @@ void Control::parsePushToggleControl(uint32 key, ZVision *engine, Common::Seekab Common::String line = stream.readLine(); trimCommentsAndWhiteSpace(&line); - while (!line.contains('}')) { + while (!stream.eos() && !line.contains('}')) { if (line.matchString("*_hotspot*", true)) { uint x; uint y; diff --git a/engines/zvision/scr_file_handling.cpp b/engines/zvision/scr_file_handling.cpp index 5b8af48047..9c99ce184d 100644 --- a/engines/zvision/scr_file_handling.cpp +++ b/engines/zvision/scr_file_handling.cpp @@ -76,7 +76,7 @@ void ScriptManager::parsePuzzle(Puzzle &puzzle, Common::SeekableReadStream &stre Common::String line = stream.readLine(); trimCommentsAndWhiteSpace(&line); - while (!line.contains('}')) { + while (!stream.eos() && !line.contains('}')) { if (line.matchString("criteria {", true)) { Puzzle::Criteria criteria; if (parseCriteria(&criteria, stream)) { @@ -103,7 +103,7 @@ bool ScriptManager::parseCriteria(Puzzle::Criteria *criteria, Common::SeekableRe return false; } - while (!line.contains('}')) { + while (!stream.eos() && !line.contains('}')) { // Split the string into tokens using ' ' as a delimiter Common::StringTokenizer tokenizer(line); Common::String token; @@ -147,7 +147,7 @@ void ScriptManager::parseResults(Common::SeekableReadStream &stream, Common::Lis trimCommentsAndWhiteSpace(&line); // TODO: Re-order the if-then statements in order of highest occurrence - while (!line.contains('}')) { + while (!stream.eos() && !line.contains('}')) { if (line.empty()) { line = stream.readLine(); trimCommentsAndWhiteSpace(&line); @@ -284,7 +284,7 @@ uint ScriptManager::parseFlags(Common::SeekableReadStream &stream) const { Common::String line = stream.readLine(); trimCommentsAndWhiteSpace(&line); - while (!line.contains('}')) { + while (!stream.eos() && !line.contains('}')) { if (line.matchString("ONCE_PER_INST", true)) { flags |= Puzzle::ONCE_PER_INST; } else if (line.matchString("DO_ME_NOW", true)) { |