summaryrefslogtreecommitdiff
path: root/mktree.c
diff options
context:
space:
mode:
Diffstat (limited to 'mktree.c')
-rw-r--r--mktree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/mktree.c b/mktree.c
index 2e84889c02..3891cd9fb3 100644
--- a/mktree.c
+++ b/mktree.c
@@ -51,9 +51,8 @@ static void write_tree(unsigned char *sha1)
qsort(entries, used, sizeof(*entries), ent_compare);
for (size = i = 0; i < used; i++)
size += 32 + entries[i]->len;
- strbuf_init(&buf);
- strbuf_grow(&buf, size);
+ strbuf_init(&buf, size);
for (i = 0; i < used; i++) {
struct treeent *ent = entries[i];
strbuf_addf(&buf, "%o %s%c", ent->mode, ent->name, '\0');
@@ -83,7 +82,7 @@ int main(int ac, char **av)
av++;
}
- strbuf_init(&sb);
+ strbuf_init(&sb, 0);
while (1) {
char *ptr, *ntr;
unsigned mode;