summaryrefslogtreecommitdiff
path: root/builtin-log.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin-log.c')
-rw-r--r--builtin-log.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin-log.c b/builtin-log.c
index fa81c25920..e1d3e7d74b 100644
--- a/builtin-log.c
+++ b/builtin-log.c
@@ -763,13 +763,13 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
sign = '-';
if (verbose) {
- char *buf = NULL;
- unsigned long buflen = 0;
- pretty_print_commit(CMIT_FMT_ONELINE, commit, ~0,
- &buf, &buflen, 0, NULL, NULL, 0);
+ struct strbuf buf;
+ strbuf_init(&buf, 0);
+ pretty_print_commit(CMIT_FMT_ONELINE, commit,
+ &buf, 0, NULL, NULL, 0);
printf("%c %s %s\n", sign,
- sha1_to_hex(commit->object.sha1), buf);
- free(buf);
+ sha1_to_hex(commit->object.sha1), buf.buf);
+ strbuf_release(&buf);
}
else {
printf("%c %s\n", sign,