From b247515c587e1b9da4765b7108ce2ae0321f13c5 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 12 Jan 2015 06:47:12 +0100 Subject: ZVISION: Check eos() after reading from stream, not before This fixes stray character in ZGI game over screen, when it reads an empty line of text. --- engines/zvision/text/text.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engines/zvision') diff --git a/engines/zvision/text/text.cpp b/engines/zvision/text/text.cpp index a5ed044424..e0501ae9c8 100644 --- a/engines/zvision/text/text.cpp +++ b/engines/zvision/text/text.cpp @@ -490,8 +490,10 @@ void TextRenderer::drawTxtInOneLine(const Common::String &text, Graphics::Surfac Common::String readWideLine(Common::SeekableReadStream &stream) { Common::String asciiString; - while (!stream.eos()) { + while (true) { uint32 value = stream.readUint16LE(); + if (stream.eos()) + break; // Check for CRLF if (value == 0x0A0D) { // Read in the extra NULL char -- cgit v1.2.3