From: Rene Scharfe Date: Thu, 2 Jun 2005 18:50:48 +0000 (+0200) Subject: [PATCH] git-tar-tree: cleanup write_trailer() X-Git-Tag: v0.99~380 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9b5b9f398c56f83839bdc4fc630f38afadc94c21;p=git.git [PATCH] git-tar-tree: cleanup write_trailer() replace open-coded variants of get_record(). Signed-off-by: Rene Scharfe Signed-off-by: Linus Torvalds --- diff --git a/tar-tree.c b/tar-tree.c index 233a25616..c2eb21c97 100644 --- a/tar-tree.c +++ b/tar-tree.c @@ -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(); } }