[c] Detecting EOF in C