[Scummvm-git-logs] scummvm master -> d831218b985c1ab66bc4e52f6b79142eb0fa79b9

dreammaster paulfgilbert at gmail.com
Sun Oct 6 20:00:46 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d831218b98 GLK: Fix reading beyond the end of a file


Commit: d831218b985c1ab66bc4e52f6b79142eb0fa79b9
    https://github.com/scummvm/scummvm/commit/d831218b985c1ab66bc4e52f6b79142eb0fa79b9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-10-06T11:00:24-07:00

Commit Message:
GLK: Fix reading beyond the end of a file

Changed paths:
    engines/glk/streams.cpp


diff --git a/engines/glk/streams.cpp b/engines/glk/streams.cpp
index 37cac44..d6d62dd 100644
--- a/engines/glk/streams.cpp
+++ b/engines/glk/streams.cpp
@@ -989,7 +989,7 @@ int IOStream::getChar() {
 	ensureOp(filemode_Read);
 	int res;
 	if (!_unicode) {
-		res = _inStream->readByte();
+		res = (_inStream->pos() >= _inStream->size()) ? -1 : _inStream->readByte();
 	} else if (_textFile) {
 		res = getCharUtf8();
 	} else {





More information about the Scummvm-git-logs mailing list