summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6fc4a7e)
raw | patch | inline | side by side (parent: 6fc4a7e)
author | Miklos Vajna <vmiklos@frugalware.org> | |
Fri, 21 Nov 2008 00:44:59 +0000 (01:44 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 25 Nov 2008 23:34:25 +0000 (15:34 -0800) |
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-clone.c | patch | blob | history |
diff --git a/builtin-clone.c b/builtin-clone.c
index 8e1a1d399580af3faa39c3c50350b3ca19df0634..275b690b3c053595e013f9594f5bfbc2c03e3503 100644 (file)
--- a/builtin-clone.c
+++ b/builtin-clone.c
}
if (is_bare) {
- char *result = xmalloc(end - start + 5);
- sprintf(result, "%.*s.git", (int)(end - start), start);
- return result;
+ struct strbuf result = STRBUF_INIT;
+ strbuf_addf(&result, "%.*s.git", (int)(end - start), start);
+ return strbuf_detach(&result, 0);
}
return xstrndup(start, end - start);