From f708a822304851500ac41d666535ae74871d2159 Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Tue, 7 Dec 2010 22:06:19 -0500 Subject: [PATCH] lib: use stream state instead of eof() to determine end of stream Using while(!eof()) on a C++ stream means it may never end if the stream enters an error state. See: http://stackoverflow.com/questions/485230/c-tokenizing-using-iterators-in-an-eof-cycle --- src/a_codsection.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/a_codsection.cc b/src/a_codsection.cc index cb31db5c..01160339 100644 --- a/src/a_codsection.cc +++ b/src/a_codsection.cc @@ -139,9 +139,7 @@ void CODSection::addFiles(const std::string& files) std::string file; std::istringstream iss(files); - while (!iss.eof()) { - std::getline(iss, file); - + while( std::getline(iss, file) ) { file = trim(file); if (file.length() > 0) -- 2.11.4.GIT