X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=dump%2Ftraverse.c;h=632a6a39d4350823cd042318a36b17dd41ff3fab;hb=ad9220730d7bc96534093e6957268db49d05f7ad;hp=e4cf7d383d924e6dfd45140e1eac77de9d174bdb;hpb=cfa03414886424d1dcc4ca41210c26d54204c444;p=dump.git diff --git a/dump/traverse.c b/dump/traverse.c index e4cf7d3..632a6a3 100644 --- a/dump/traverse.c +++ b/dump/traverse.c @@ -41,7 +41,7 @@ #ifndef lint static const char rcsid[] = - "$Id: traverse.c,v 1.33 2001/04/11 13:42:52 stelian Exp $"; + "$Id: traverse.c,v 1.35 2001/07/18 08:50:58 stelian Exp $"; #endif /* not lint */ #include @@ -55,7 +55,11 @@ static const char rcsid[] = #include #include #ifdef __linux__ +#ifdef HAVE_EXT2FS_EXT2_FS_H +#include +#else #include +#endif #include #include #include @@ -917,8 +921,8 @@ dumpino(struct dinode *dp, dump_ino_t ino) ext2fs_block_iterate2(fs, (ext2_ino_t)ino, 0, NULL, dumponeblock, (void *)&bc); /* deal with holes at the end of the inode */ - remaining = i_size - bc.next_block*sblock->fs_fsize; - if (remaining > 0) + if (i_size > bc.next_block*sblock->fs_fsize) { + remaining = i_size - bc.next_block*sblock->fs_fsize; for (i = 0; i < howmany(remaining, sblock->fs_fsize); i++) { bc.buf[bc.cnt++] = 0; if (bc.cnt == bc.max) { @@ -926,6 +930,7 @@ dumpino(struct dinode *dp, dump_ino_t ino) bc.cnt = 0; } } + } if (bc.cnt > 0) { blksout (bc.buf, bc.cnt, bc.ino); }