From: Felipe Contreras Date: Sun, 14 Apr 2013 23:22:16 GMT Subject: Re: [PATCH] branch: colour upstream branches Message-ID: In-Reply-To: On Sun, Apr 14, 2013 at 5:31 PM, Duy Nguyen wrote: > On Sun, Apr 14, 2013 at 11:46 AM, Felipe Contreras > wrote: >> + char fancy[80]; >> >> - if (show_upstream_ref) >> + if (show_upstream_ref) { >> ref = shorten_unambiguous_ref(branch->merge[0]->dst, 0); >> + if (want_color(branch_use_color)) >> + snprintf(fancy, sizeof(fancy), "%s%s%s", >> + GIT_COLOR_BLUE, ref, GIT_COLOR_RESET); >> + else >> + strncpy(fancy, ref, sizeof(fancy)); >> + } >> + > > Please use strbuf for "fancy". Why? We would need to initialize and free it. What's the advantage? -- Felipe Contreras