This patch swaps 'size' and 'nmemb' arguments of fread.
The fread returns always 1 (because 'nmemb' is 1) so checking
the return value is always failure.
Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
exit(EXIT_FAILURE);
}
- read = fread(&header, sizeof(header), 1, file);
+ read = fread(&header, 1, sizeof(header), file);
if (read != sizeof(header)) {
fprintf(stderr, "Unable to read header \n");
fclose(file);