1
0
mirror of https://github.com/git/git.git synced 2024-09-28 13:33:31 +02:00

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>
This commit is contained in:
Miklos Vajna 2008-11-21 01:44:59 +01:00 committed by Junio C Hamano
parent 6fc4a7e546
commit 32716a2c6c

@ -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);