X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=config.c;h=b8d289d21789b5017579d90b7894db8ebee4c47a;hb=1689c5de8730ea334535337a341db3c7a21ad002;hp=18d305c890d3f4ba00962cfa4033ff9ed68cf95b;hpb=78a935d48b28ebf5b1af348d7e57763f2955afd1;p=git.git diff --git a/config.c b/config.c index 18d305c89..b8d289d21 100644 --- a/config.c +++ b/config.c @@ -753,9 +753,8 @@ static int store_write_section(int fd, const char* key) { const char *dot; int i, success; - struct strbuf sb; + struct strbuf sb = STRBUF_INIT; - strbuf_init(&sb, 0); dot = memchr(key, '.', store.baselen); if (dot) { strbuf_addf(&sb, "[%.*s \"", (int)(dot - key), key); @@ -780,7 +779,7 @@ static int store_write_pair(int fd, const char* key, const char* value) int i, success; int length = strlen(key + store.baselen + 1); const char *quote = ""; - struct strbuf sb; + struct strbuf sb = STRBUF_INIT; /* * Check to see if the value needs to be surrounded with a dq pair. @@ -797,7 +796,6 @@ static int store_write_pair(int fd, const char* key, const char* value) if (i && value[i - 1] == ' ') quote = "\""; - strbuf_init(&sb, 0); strbuf_addf(&sb, "\t%.*s = %s", length, key + store.baselen + 1, quote);