threads / patch / 7837

patch, 5 partsinit_buffer(): Kill buf pointer

Subject: [PATCH 5/5] init_buffer(): Kill buf pointer

## tl;dr

One message between Apr 25, 2007 and Apr 25, 2007. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Luiz Fernando N. Capitulino· Apr 25, 2007, 14:18 UTC · lore
We don't need it, it's possible to assign the block of memory to bufp
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
---
 builtin-commit-tree.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
Show changes to builtin-commit-tree.c +1 −2
diff --git a/builtin-commit-tree.c b/builtin-commit-tree.c
index 4a8d8d8..ccbcbe3 100644
--- a/builtin-commit-tree.c
+++ b/builtin-commit-tree.c
@@ -16,9 +16,8 @@
  */
 static void init_buffer(char **bufp, unsigned int *sizep)
 {
-	char *buf = xmalloc(BLOCKING);
+	*bufp = xmalloc(BLOCKING);
 	*sizep = 0;
-	*bufp = buf;
 }
 
 static void add_buffer(char **bufp, unsigned int *sizep, const char *fmt, ...)
-- 
1.5.1.1.320.g1cf2

← back to recent threads