The value of EOF is platform-specific, but is commonly -1. I'm fairly sure it's never 0.
But I was referring more to the fact that c is set exactly once in line 4 (`int c = getc(fd)`), outside of the nested loops, and never touched again. So if it's not initially a NULL, newline or CR, it never will be, and the inner loop will never exit.