Fix offset calculation to actually rewrite the _last_ block.
This commit is contained in:
parent
a8e5e7c520
commit
deb35287b3
@ -1567,9 +1567,9 @@ main(int argc, char **argv)
|
||||
testbuf = malloc(sblock.fs_fsize);
|
||||
if (testbuf == NULL)
|
||||
err(1, "malloc");
|
||||
rdfs((ufs2_daddr_t)((size / DEV_BSIZE) - sblock.fs_fsize),
|
||||
rdfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE),
|
||||
sblock.fs_fsize, testbuf, fsi);
|
||||
wtfs((ufs2_daddr_t)((size / DEV_BSIZE) - sblock.fs_fsize),
|
||||
wtfs((ufs2_daddr_t)((size - sblock.fs_fsize) / DEV_BSIZE),
|
||||
sblock.fs_fsize, testbuf, fso, Nflag);
|
||||
free(testbuf);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user