From d5724a2eda6888a37534b5c14c92bcbf84a815a1 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 26 Jan 2010 21:27:13 +0000 Subject: Fixed reading of options file (game.opt) for Hoyle 3 svn-id: r47575 --- engines/sci/engine/kfile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'engines/sci/engine/kfile.cpp') diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp index 2cd6a75575..7b1daf665e 100644 --- a/engines/sci/engine/kfile.cpp +++ b/engines/sci/engine/kfile.cpp @@ -225,7 +225,11 @@ static void fgets_wrapper(EngineState *s, char *dest, int maxsize, int handle) { error("fgets_wrapper: Trying to read from file '%s' opened for writing", f->_name.c_str()); return; } - f->_in->readLine(dest, maxsize); + if (maxsize > 1) + f->_in->readLine(dest, maxsize); + else + *dest = f->_in->readByte(); + // The returned string must not have an ending LF int strSize = strlen(dest); if (strSize > 0) { -- cgit v1.2.3