If we are already at EOF we do nothing to skip until EOL

This commit is contained in:
Andreas Fabri 2016-02-18 11:48:20 +01:00
parent e14dca898f
commit af9b2ee0de
1 changed files with 3 additions and 0 deletions

View File

@ -108,6 +108,9 @@ std::istream& operator>>( std::istream& in, File_header_extended_OFF& h);
// istream modifier skips chars until end of line.
inline std::istream& skip_until_EOL( std::istream& in) {
if(in.eof()){
return in;
}
char c;
while ( in.get(c) && c != '\n')
;