summaryrefslogtreecommitdiff
path: root/src/cherrypick.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-04-18 00:34:04 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-04-18 00:34:04 +0200
commit2bed3553f4595a42d9a6884edc66b991e21f881e (patch)
treeb426ecd3b9033c4ffe83741cfce74e855cf0c328 /src/cherrypick.c
parentc5cacc4ec2c13e93164b8e3013b0d18c8c6d820c (diff)
downloadlibgit2-2bed3553f4595a42d9a6884edc66b991e21f881e.tar.gz
cherry-pick: terminate the commit id string
We treat this as a NUL-terminated string, so make sure that we add the terminator.
Diffstat (limited to 'src/cherrypick.c')
-rw-r--r--src/cherrypick.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cherrypick.c b/src/cherrypick.c
index 67a2c6af3..6a5ca834c 100644
--- a/src/cherrypick.c
+++ b/src/cherrypick.c
@@ -187,7 +187,7 @@ int git_cherry_pick(
goto on_error;
}
- git_oid_fmt(commit_oidstr, git_commit_id(commit));
+ git_oid_nfmt(commit_oidstr, sizeof(commit_oidstr), git_commit_id(commit));
if ((error = write_merge_msg(repo, commit_msg)) < 0 ||
(error = git_buf_printf(&their_label, "%.7s... %s", commit_oidstr, commit_summary)) < 0 ||