Re: [PATCH 1/2 v2] Add strbuf_vaddf(), use it in strbuf_addf(), and add strbuf_initf()
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Mar 6, 2008, 16:38 UTC
- Message-ID
- <47D01E0D.1090801@viscovery.net>
- In-Reply-To
- <alpine.LSU.1.00.0803061727120.3941@racer.site>
Johannes Schindelin schrieb:
Show 11 quoted lines
> The most common use of addf() was to init a strbuf and addf() right away. > Since it is so common, it makes sense to have a function strbuf_initf() to > wrap both calls into one. > > To do that, we implement a (really minimal) vaddf() lookalike to > vsprintf(). > > At the moment, it only handles %u, %i, %d, %l, %o, %x and %X with size > indicators '<number>', ' <number>' and '0<number>', as well as %c and %s, > the latter with size indicators '.*' in addition to the same size > indicators as for numbers.
WTF?
You did not cater for PRIuMAX, which is %llu except on Windows, where it is %I64u. We can make it %llu on Windows only if we can ensure that none of its uses ends up in a regular *printf function!
-- Hannes