fread() returns 0 on eof or error, not EOF. This fixes the following bug:
fread() returns 0 on eof or error, not EOF. This fixes the following
bug:

  "head -c <n>" never exit and loops forever (until it is killed),
  if the input stream has fewer bytes than specified (n).

PR:		bin/8225
Submitted-by:	FUJIMOTO Kensaku <ef879192bb1e41d519c82cf76440dc8e9a530806@oscar.elec.waseda.ac.jp>

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase