Code

Don't ignore a pack-refs write failure
[git.git] / commit.c
index 40c87a7471ba3520d5543fa07280c9277a832672..03436b1b077f3f83cebceb697f97c3ba5b26265c 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -27,7 +27,7 @@ struct sort_node
 
 const char *commit_type = "commit";
 
-struct cmt_fmt_map {
+static struct cmt_fmt_map {
        const char *n;
        size_t cmp_len;
        enum cmit_fmt v;
@@ -997,7 +997,7 @@ static void pp_header(enum cmit_fmt fmt,
                        len = linelen;
                        if (fmt == CMIT_FMT_EMAIL)
                                len = bound_rfc2047(linelen, encoding);
-                       ALLOC_GROW(*buf_p, *ofs_p + len, *space_p);
+                       ALLOC_GROW(*buf_p, *ofs_p + len + 80, *space_p);
                        dst = *buf_p + *ofs_p;
                        *ofs_p += add_user_info("Author", fmt, dst,
                                                line + 7, dmode, encoding);
@@ -1008,7 +1008,7 @@ static void pp_header(enum cmit_fmt fmt,
                        len = linelen;
                        if (fmt == CMIT_FMT_EMAIL)
                                len = bound_rfc2047(linelen, encoding);
-                       ALLOC_GROW(*buf_p, *ofs_p + len, *space_p);
+                       ALLOC_GROW(*buf_p, *ofs_p + len + 80, *space_p);
                        dst = *buf_p + *ofs_p;
                        *ofs_p += add_user_info("Commit", fmt, dst,
                                                line + 10, dmode, encoding);