AFAIK if you don't `fopen` with explicitely specifying binary mode, then windows will not `fread` all characters of the input file into your buffer. When the input file is not opened in binary mode, windows will modify the line endings (CRLF -> LF) and eat other characters too (I think 0x00 and Ctrl-Z).