Fixed wrong condition

Assume you started on line 42 of a 120 long file, the loop will go until line 164 instead of 120 if it doesn't find one.