Quote Originally Posted by convenientstore View Post
1) line 58, not sure why i is being returned at all. .Looks like useless return?
Look at how i is being generated and subsequently used in the for() and while loops. When a for loop breaks, it ceases to iterate, leaving "i" at a value less than it would have been. So if no match is found with the strcmp in the loop at line 30, "i" will end up equal to num_remind. If you look at the conditions of the loop on line 32, you will see that if i == num_remind, this loop will not even happen once.

Just apply the same logic to the while loop in read_line(). It's just dead simple arithmetic, on the level of 2+2=4.