From: Junio C Hamano Date: Wed, 03 Oct 2007 00:22:23 GMT Subject: Re: [PATCH] Change "refs/" references to symbolic constants Message-ID: <7vr6kdhwsg.fsf@gitster.siamese.dyndns.org> In-Reply-To: <20071002204848.GA8284@coredump.intra.peff.net> Jeff King writes: > Perhaps a better quest would be to eliminate all of those counts > entirely with code that is obviously correct. I think it is much more > readable to replace: > > url = xmalloc(strlen(repo->base) + 64); > sprintf(url, "%s/objects/pack/pack-%s.idx", repo->base, hex); > > with something like: > > strbuf_init(&url); > strbuf_addf(&url, "%s/objects/pack/pack-%s.idx", repo->base, hex); Ugh, this typically calls snprintf() twice doesn't it?