Alasdair Sinclair : msvcrt: If we' re at EOF in the buffer and we have pattern %n in format string we should not count the EOF in the total .