From 96172669053bbba7263a370f109f70615049a0c6 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 14 May 2012 21:37:36 -0600 Subject: Improved detection of iostream's eof() condition --- src/csv.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/csv.cc') diff --git a/src/csv.cc b/src/csv.cc index 1e55129e..71b6516a 100644 --- a/src/csv.cc +++ b/src/csv.cc @@ -87,7 +87,7 @@ char * csv_reader::next_line(std::istream& in) while (in.good() && ! in.eof() && in.peek() == '#') in.getline(context.linebuf, parse_context_t::MAX_LINE); - if (! in.good() || in.eof()) + if (! in.good() || in.eof() || in.peek() == -1) return NULL; in.getline(context.linebuf, parse_context_t::MAX_LINE); -- cgit v1.2.3