Wouldn't it stop when it gets to a new line or when it reaches EOF due to the while loop that it is in? Also it is suppose to get the length of the REST of the line..since the getline stops whenever it reaches its MAXLINE limit. The main purpose of the program is to print out the length of the longest line, and print out as much as possible of the line as limited by MAXLINE.