From: Francois Fleuret Date: Sat, 28 Mar 2009 22:38:50 +0000 (+0100) Subject: Fixed a bug with getline() failing at the EOF. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=af6718c8f1558ff16954ff7e6808fc5f0bcf9428;p=selector.git Fixed a bug with getline() failing at the EOF. --- diff --git a/selector.cc b/selector.cc index f5b9d2d..3f8aba7 100644 --- a/selector.cc +++ b/selector.cc @@ -544,14 +544,14 @@ int main(int argc, char **argv) { file.getline(raw_line, buffer_size); - if(file.fail()) { - cerr << "Line too long." << endl; - cerr << raw_line << endl; - exit(1); - } - if(raw_line[0]) { + if(file.fail()) { + cerr << "Line too long:" << endl; + cerr << raw_line << endl; + exit(1); + } + char *s, *t; const char *u;