DORMANTno replies

[PATCH] git-tar-tree: cleanup write_trailer() (resent)

From: Rene Scharfe <hidden>
Date: 2016-06-15 22:41:59
Subsystem: the rest · Maintainer: Linus Torvalds

git-tar-tree: replace open-coded variants of get_record().

Signed-off-by: Rene Scharfe <redacted>
diff --git a/tar-tree.c b/tar-tree.c
--- 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();
 	}
 }
 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help