diff --git a/source/mijin/io/stream.cpp b/source/mijin/io/stream.cpp index cb74884..2124edb 100644 --- a/source/mijin/io/stream.cpp +++ b/source/mijin/io/stream.cpp @@ -240,7 +240,7 @@ StreamError Stream::readLine(std::string& outString) outString.clear(); bool done = false; - while(!done) + while (!done) { // read into the buffer std::size_t bytesRead = 0; @@ -270,6 +270,11 @@ StreamError Stream::readLine(std::string& outString) { return error; } + + if (isAtEnd()) + { + done = true; + } } return StreamError::SUCCESS;