diff options
author | Miklos Vajna <vmiklos@frugalware.org> | 2008-11-21 01:44:59 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-11-25 15:34:25 -0800 |
commit | 32716a2c6c238113c9a5af116e5ab6f3f4ecde8d (patch) | |
tree | 5c4b985623ec2deadcb7b4e52250a63791758c86 /builtin-clone.c | |
parent | 6fc4a7e546d5e2b0ce545f73b5c1829887db2462 (diff) | |
download | git-32716a2c6c238113c9a5af116e5ab6f3f4ecde8d.tar.gz |
builtin-clone: use strbuf in guess_dir_name()
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-clone.c')
-rw-r--r-- | builtin-clone.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin-clone.c b/builtin-clone.c index 8e1a1d3995..275b690b3c 100644 --- a/builtin-clone.c +++ b/builtin-clone.c @@ -134,9 +134,9 @@ static char *guess_dir_name(const char *repo, int is_bundle, int is_bare) } 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); |