diff options
Diffstat (limited to 'tools.cpp')
-rw-r--r-- | tools.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -17,12 +17,16 @@ using namespace tnt; istream& operator>>( istream& is, tChannelID& ret ) { - if ( is.rdbuf()->in_avail() > 0 ) { - string line; - if ( !getline( is, line ) || ( !line.empty() && !( ret = tChannelID::FromString( line.c_str() ) ).Valid() ) ) - is.setstate( ios::badbit ); - } - return is; + string line; + if ( !getline( is, line ) ) { + if ( !is.eof() ) + is.setstate( ios::badbit ); + return is; + } + + if ( !line.empty() && !( ret = tChannelID::FromString( line.c_str() ) ).Valid() ) + is.setstate( ios::badbit ); + return is; } namespace vdrlive { |