Fix offset calculation to actually rewrite the _last_ block.

This commit is contained in:
Edward Tomasz Napierala 2012-05-06 11:48:37 +00:00
parent a8e5e7c520
commit deb35287b3

View File

@ -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);