I also moved the multiple `strlen(line)` calls to a single initialization at the top.