Wouldn't that crash if the file only consists of a comment, but nothing else? then start_index points beyond the EOF.