summaryrefslogtreecommitdiff
path: root/builtin/show-branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-09-04 17:34:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-04 17:34:19 (GMT)
commitef0e938a1a4b34bc0882e1c542c8e99c98737f7d (patch)
tree95fd055bd45588d16eea7a93158ce92d6489c066 /builtin/show-branch.c
parent8545932d45c91437ac439b1a2df12cf397f71311 (diff)
parentecad27cf98c391d5cfdc26ce0e442e02347baad0 (diff)
downloadgit-ef0e938a1a4b34bc0882e1c542c8e99c98737f7d.zip
git-ef0e938a1a4b34bc0882e1c542c8e99c98737f7d.tar.gz
git-ef0e938a1a4b34bc0882e1c542c8e99c98737f7d.tar.bz2
Sync with 2.3.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 f3fb5fb..9b0aba2 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -723,7 +723,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
if (reflog) {
unsigned char sha1[20];
- char nth_desc[256];
char *ref;
int base = 0;
unsigned int flags = 0;
@@ -762,6 +761,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;
@@ -780,8 +780,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, sha1, 1);
+ free(nth_desc);
}
free(ref);
}