When they hit C, they wrote code around fgets that processes the last line twice:
while (!feof(instream)) { fgets(linebuf, sizeof linebuf, instream); process_line(linebuf); }
while (!feof(instream)) { char ch = getc(instream); switch (ch) ... }
When they hit C, they wrote code around fgets that processes the last line twice:
Or processes the EOF value from getc as a character: