From: Florian Krohm Date: Sun, 16 Dec 2012 22:44:32 +0000 (+0000) Subject: Teach vprintf_wrk about '*' as format width, in which case the width X-Git-Tag: svn/VALGRIND_3_9_0^2~191 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=348e56994500b5cbad1224b839c4e4bb51bfe62d;p=thirdparty%2Fvalgrind.git Teach vprintf_wrk about '*' as format width, in which case the width is given in an argument. git-svn-id: svn://svn.valgrind.org/vex/trunk@2591 --- diff --git a/VEX/priv/main_util.c b/VEX/priv/main_util.c index b14adfb5d5..baee415914 100644 --- a/VEX/priv/main_util.c +++ b/VEX/priv/main_util.c @@ -366,9 +366,14 @@ UInt vprintf_wrk ( void(*sink)(HChar), format++; padchar = '0'; } - while (*format >= '0' && *format <= '9') { - fwidth = fwidth * 10 + (*format - '0'); + if (*format == '*') { + fwidth = va_arg(ap, Int); format++; + } else { + while (*format >= '0' && *format <= '9') { + fwidth = fwidth * 10 + (*format - '0'); + format++; + } } if (*format == 'l') { format++;