From 293e59038d87c67336257e719cecdb85e146538b Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 7 Mar 2020 08:48:34 +0000 Subject: [PATCH] Fixed problem with width modifier. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@13396 27425a3e-05d8-49a3-a47f-9c15f0e5edd8 --- os/hal/lib/streams/chprintf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/os/hal/lib/streams/chprintf.c b/os/hal/lib/streams/chprintf.c index 48c9b1d60..681df1082 100644 --- a/os/hal/lib/streams/chprintf.c +++ b/os/hal/lib/streams/chprintf.c @@ -172,8 +172,10 @@ int chvprintf(BaseSequentialStream *chp, const char *fmt, va_list ap) { } /* Width modifier.*/ - if (c == '*') { + if ( *fmt == '*') { width = va_arg(ap, int); + ++fmt; + c = *fmt++; } else { width = 0;