diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-03-20 19:49:12 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-03-20 19:49:12 +0100 |
commit | d08a134e8d0668ba3961041b02297d308e2f9f93 (patch) | |
tree | 524e0523c788aa7a50434520092985ad460f97fe /tools.cpp | |
parent | ae21d7d32eff88f3384887ebcd8341039681b223 (diff) | |
download | vdr-plugin-live-d08a134e8d0668ba3961041b02297d308e2f9f93.tar.gz vdr-plugin-live-d08a134e8d0668ba3961041b02297d308e2f9f93.tar.bz2 |
fix for #357 and #410
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 { |