From: Mikko Rasa Date: Sun, 8 Jan 2017 11:59:57 +0000 (+0200) Subject: Guard against badly behaving get functions in getline X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=bd892a8afd93f849aec21706a009f69a5868b34d;hp=08b840ac3ce9f167045c380e0ebb8266d01fd65d;ds=sidebyside Guard against badly behaving get functions in getline --- diff --git a/source/io/base.cpp b/source/io/base.cpp index da2b5a9..95a3685 100644 --- a/source/io/base.cpp +++ b/source/io/base.cpp @@ -31,7 +31,7 @@ bool Base::getline(string &line) if(eof_flag) return false; - while(1) + while(!eof()) { int c = get(); if(c==-1 || c=='\n')