From: Daniel Stenberg Date: Tue, 20 Nov 2007 10:03:33 +0000 (+0000) Subject: fix the treatment of the parameter-based precision, as in "%.*s%s" as X-Git-Tag: curl-7_18_0~256 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f928797cf18d41d4ae0114958cfedac3fcd6c13;p=thirdparty%2Fcurl.git fix the treatment of the parameter-based precision, as in "%.*s%s" as previously the second %s would wrongly get the numerical argument that is used for the variable precision for the first %s... --- diff --git a/lib/mprintf.c b/lib/mprintf.c index b3fc339228..bba1a6481f 100644 --- a/lib/mprintf.c +++ b/lib/mprintf.c @@ -686,8 +686,11 @@ static int dprintf_formatf( width = p->width; /* pick up the specified precision */ - if(p->flags & FLAGS_PRECPARAM) + if(p->flags & FLAGS_PRECPARAM) { prec = vto[p->precision].data.num; + param_num++; /* since the precision is extraced from a parameter, we + must skip that to get to the next one properly */ + } else if(p->flags & FLAGS_PREC) prec = p->precision; else