]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Teach vprintf_wrk about '*' as format width, in which case the width
authorFlorian Krohm <florian@eich-krohm.de>
Sun, 16 Dec 2012 22:44:32 +0000 (22:44 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sun, 16 Dec 2012 22:44:32 +0000 (22:44 +0000)
is given in an argument.

git-svn-id: svn://svn.valgrind.org/vex/trunk@2591

VEX/priv/main_util.c

index b14adfb5d55379cb17202abe72340254b8b8008a..baee415914c1d13ed5c81120e903258f7f2a4c9a 100644 (file)
@@ -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++;