Proper amount of data to dump
This commit is contained in:
parent
f3ebde09ef
commit
3b5be84676
1 changed files with 2 additions and 1 deletions
|
@ -633,7 +633,8 @@ int main(int argc, char *const argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finally save all keys + data to file
|
// Finally save all keys + data to file
|
||||||
if (fwrite(&mtDump, 1, sizeof(mtDump), pfDump) != sizeof(mtDump)) {
|
uint16_t dump_size = (t.num_blocks + 1) * t.num_sectors;
|
||||||
|
if (fwrite(&mtDump, 1, dump_size, pfDump) != dump_size) {
|
||||||
fprintf(stdout, "Error, cannot write dump\n");
|
fprintf(stdout, "Error, cannot write dump\n");
|
||||||
fclose(pfDump);
|
fclose(pfDump);
|
||||||
goto error;
|
goto error;
|
||||||
|
|
Loading…
Reference in a new issue