- buf = malloc(mtdsize);
- if (!buf) {
- perror("malloc");
- exit(1);
- }
-
- res = pread(fd, buf, mtdsize, block_offset);
- if (res != mtdsize) {
- perror("pread");
- exit(1);
- }
-
- if (seama_fix_md5(shdr, buf, mtdsize))
+ if (seama_fix_md5(shdr, fd, mtdsize, block_offset))