Code

Build: add NO_UINTMAX_T to support ancient systems
[git.git] / pretty.c
index 8beafa08d3927e943a94279f5d776d6a45c673c5..1e799433395afa935b5ac1454c299ae873873893 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -234,7 +234,7 @@ static char *get_header(const struct commit *commit, const char *key)
 
 static char *replace_encoding_header(char *buf, const char *encoding)
 {
-       struct strbuf tmp;
+       struct strbuf tmp = STRBUF_INIT;
        size_t start, len;
        char *cp = buf;
 
@@ -250,7 +250,6 @@ static char *replace_encoding_header(char *buf, const char *encoding)
                return buf; /* should not happen but be defensive */
        len = cp + 1 - (buf + start);
 
-       strbuf_init(&tmp, 0);
        strbuf_attach(&tmp, buf, strlen(buf), strlen(buf) + 1);
        if (is_encoding_utf8(encoding)) {
                /* we have re-coded to UTF-8; drop the header */