[PATCH] git-tar-tree: cleanup write_trailer()
authorRene Scharfe <rene.scharfe@lsrfire.ath.cx>
Thu, 2 Jun 2005 18:50:48 +0000 (20:50 +0200)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 3 Jun 2005 01:30:08 +0000 (18:30 -0700)
replace open-coded variants of get_record().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
tar-tree.c
index 233a25616e39ee40199d12a75cea76c11246385f..c2eb21c97bd75567ded74e89b2b118730710ba01 100644 (file)
@@ -73,16 +73,13 @@ static char *get_record(void)
  */
 static void write_trailer(void)
 {
-       memset(block + offset, 0, RECORDSIZE);
-       offset += RECORDSIZE;
+       get_record();
        write_if_needed();
-       memset(block + offset, 0, RECORDSIZE);
-       offset += RECORDSIZE;
+       get_record();
        write_if_needed();
        if (offset) {
-               memset(block + offset, 0, BLOCKSIZE - offset);
-               reliable_write(block, BLOCKSIZE);
-               offset = 0;
+               get_record();
+               write_if_needed();
        }
 }