diff options
author | Paul Gilbert | 2019-10-06 11:00:24 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-10-06 11:00:24 -0700 |
commit | d831218b985c1ab66bc4e52f6b79142eb0fa79b9 (patch) | |
tree | 2a99ca7a12d5df5d7935532e78b6b997c31d95eb /engines/glk | |
parent | e06ec24807e88d688c67539d20efe41d165aa608 (diff) | |
download | scummvm-rg350-d831218b985c1ab66bc4e52f6b79142eb0fa79b9.tar.gz scummvm-rg350-d831218b985c1ab66bc4e52f6b79142eb0fa79b9.tar.bz2 scummvm-rg350-d831218b985c1ab66bc4e52f6b79142eb0fa79b9.zip |
GLK: Fix reading beyond the end of a file
Diffstat (limited to 'engines/glk')
-rw-r--r-- | engines/glk/streams.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/glk/streams.cpp b/engines/glk/streams.cpp index 37cac4437a..d6d62ddbec 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 { |