Change fprintf() to fwrite()