Why line++ ?  The while loop is about to simply over-write line anyway.