Guard against badly behaving get functions in getline
authorMikko Rasa <tdb@tdb.fi>
Sun, 8 Jan 2017 11:59:57 +0000 (13:59 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jan 2017 12:14:23 +0000 (14:14 +0200)
source/io/base.cpp

index da2b5a98cb1c8db3f211b292137783b0c19d4e7d..95a3685fc34021322b800e185e7a52c9343d8521 100644 (file)
@@ -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')