summaryrefslogtreecommitdiff
path: root/builtin/show-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-04 17:43:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-04 17:43:23 (GMT)
commit3d3caf0b78106c390fc5daceb95ee968312765dd (patch)
treed41a558b9e3cc7ad256636f103fdf243a8bf7c19 /builtin/show-branch.c
parentfb8880dea3111deb4b1134471aa36f99285d86dc (diff)
parent74b67638166ca2e66497ede559dbf393e7af8b40 (diff)
downloadgit-3d3caf0b78106c390fc5daceb95ee968312765dd.zip
git-3d3caf0b78106c390fc5daceb95ee968312765dd.tar.gz
git-3d3caf0b78106c390fc5daceb95ee968312765dd.tar.bz2
Sync with 2.4.9
Diffstat (limited to 'builtin/show-branch.c')
-rw-r--r--builtin/show-branch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 323f857..344ae4c 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -730,7 +730,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
if (reflog) {
struct object_id oid;
- char nth_desc[256];
char *ref;
int base = 0;
unsigned int flags = 0;
@@ -769,6 +768,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
for (i = 0; i < reflog; i++) {
char *logmsg;
+ char *nth_desc;
const char *msg;
unsigned long timestamp;
int tz;
@@ -787,8 +787,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
show_date(timestamp, tz, 1),
msg);
free(logmsg);
- sprintf(nth_desc, "%s@{%d}", *av, base+i);
+
+ nth_desc = xstrfmt("%s@{%d}", *av, base+i);
append_ref(nth_desc, &oid, 1);
+ free(nth_desc);
}
free(ref);
}