diff options
author | Paul Gilbert | 2019-05-15 16:33:58 -1000 |
---|---|---|
committer | Paul Gilbert | 2019-05-15 16:33:58 -1000 |
commit | 68ef5ebfd6f842b152a8bb03ade5be0b6b526fd8 (patch) | |
tree | 18ba01dd50cca099baba65a2375216fe978e2fcd | |
parent | 84bd8c6b46b405c3c14e8be6868d3a1534879d52 (diff) | |
download | scummvm-rg350-68ef5ebfd6f842b152a8bb03ade5be0b6b526fd8.tar.gz scummvm-rg350-68ef5ebfd6f842b152a8bb03ade5be0b6b526fd8.tar.bz2 scummvm-rg350-68ef5ebfd6f842b152a8bb03ade5be0b6b526fd8.zip |
GLK: HUGO: Fix reading savegame serial
-rw-r--r-- | engines/glk/hugo/hugo.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/glk/hugo/hugo.h b/engines/glk/hugo/hugo.h index 2be3bfd680..882917c38a 100644 --- a/engines/glk/hugo/hugo.h +++ b/engines/glk/hugo/hugo.h @@ -1040,9 +1040,9 @@ private: char *hugo_fgets(char *buf, int max, Common::SeekableReadStream *s) { char *ptr = buf; char c; - while (s->pos() < s->size()) { + while (s->pos() < s->size() && --max > 0) { c = hugo_fgetc(s); - if (c == '\n' || c == '\0' || (max-- == 0)) + if (c == '\n' || c == '\0') break; *ptr++ = c; } |