Print error when getline() fails (thanks to Ivan Stankovic)