]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-rev-list.c
Drop strbuf's 'eof' marker, and make read_line a first class citizen.
[git.git] / builtin-rev-list.c
index 8efd609b12e3c8cf20fbe1bf5c0d55643d34ea3c..4fd4b6bec1a91761f2cb5b52ce69d211fa97f78e 100644 (file)
@@ -80,13 +80,12 @@ static void show_commit(struct commit *commit)
                putchar('\n');
 
        if (revs.verbose_header) {
-               char *buf = NULL;
-               unsigned long buflen = 0;
-               pretty_print_commit(revs.commit_format, commit, ~0,
-                                   &buf, &buflen,
-                                   revs.abbrev, NULL, NULL, revs.date_mode);
-               printf("%s%c", buf, hdr_termination);
-               free(buf);
+               struct strbuf buf;
+               strbuf_init(&buf, 0);
+               pretty_print_commit(revs.commit_format, commit,
+                                       &buf, revs.abbrev, NULL, NULL, revs.date_mode);
+               printf("%s%c", buf.buf, hdr_termination);
+               strbuf_release(&buf);
        }
        maybe_flush_or_die(stdout, "stdout");
        if (commit->parents) {
@@ -300,7 +299,7 @@ static struct commit_list *find_bisection(struct commit_list *list,
        show_list("bisection 2 sorted", 0, nr, list);
 
        *all = nr;
-       weights = xcalloc(on_list, sizeof(int*));
+       weights = xcalloc(on_list, sizeof(*weights));
        counted = 0;
 
        for (n = 0, p = list; p; p = p->next) {