Skip to contentSkip to conversation

init_buffer(): Kill buf pointer

PATCH In review Luiz Fernando N. Capitulino 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 5/5 init_buffer(): Kill buf pointer

We don't need it, it's possible to assign the block of memory to bufp

---
 builtin-commit-tree.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
builtin-commit-tree.c +1 -2
index 4a8d8d8..ccbcbe3 100644
@@ -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, ...)
Signature · 1 line
1.5.1.1.320.g1cf2