From: Johannes Schindelin Date: Tue, 31 Jul 2007 14:57:34 GMT Subject: Re: [PATCH 3/5] Add strbuf_printf() to do formatted printing to a strbuf. Message-ID: In-Reply-To: <1185891786.11086.40.camel@hinata.boston.redhat.com> Hi, On Tue, 31 Jul 2007, Kristian H?gsberg wrote: > On Mon, 2007-07-30 at 21:36 -0700, Junio C Hamano wrote: > > Kristian Høgsberg writes: > > > > > +void strbuf_printf(struct strbuf *sb, const char *fmt, ...) > > > +{ > > > + char one_line[2048]; > > > + va_list args; > > > + int len; > > > > Such a nice abstraction so far, and then at the highest level of > > callchain we have this hardcoded limit? > > Yeah, I know, it sucks. I'd like to just run vsnprintf with a 0-sized > buffer to get the length, and then grow the buffer by that much, but > that's not very portable as far as I know. We do have nfvasprintf()... Ciao, Dscho