Fix the 'ignoring return value of ‘fread’, declared with attribute warn_unused_result' warnings