You seem to know that infile can return false when the previous read failed, as that's the point behind "while (infile)" in the first place. But it's not prescient -- it doesn't know that the next...