title: fread() returns incorrect data
body: <p>I am trying to read 128KB binary file in chunks of 256 Bytes. The first 20-40 bytes of 256 bytes seems to be always correct. However after that the data gets corrupted. I tried reading the file and writing it into another binary file and compared. More than half of the data is corrupted. Here is my code</p>
  
  <pre><code>uint8_t buffer[256]
  read_bin_file = fopen("vtest.bin", "r");
  if (read_bin_file == NULL)
  {
      printf("Unable to open file\n");
      return false;
  }
  
  test_bin = fopen("test_file.bin", "w");
  if (test_file == NULL)
  {
      printf("Unable to open file\n");
      return false;
  }
  
  fflush(stdout);
  
  for (i = 0; i &lt;=0x1FF; i++)
  {
      file_Read_pointer = i * 256;
      fseek(read_bin_file, file_Read_pointer, SEEK_SET);
      fread(buffer, 256, 1, read_bin_file);
      fseek(test_file, file_Read_pointer, SEEK_SET);
      fwrite(buffer, 256, 1, test_file);
  
  }
  </code></pre>
  
  <p>What is that I am missing?
  Also when i try to increase the bytes read from 256 to 1024 ( i&lt;0x7F) the error seems to decrease significantly. The file is almost 90% matching</p>