From 4709f23f52810f569d48b8bb553d59147f2d8735 Mon Sep 17 00:00:00 2001 From: 13163223717 <52434765+13163223717@users.noreply.github.com> Date: Wed, 3 Jul 2019 16:05:11 +0800 Subject: [PATCH] Update qprintf.c Add two case of format --- sw/libs/string_lib/src/qprintf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sw/libs/string_lib/src/qprintf.c b/sw/libs/string_lib/src/qprintf.c index a83cf702..7201b66b 100755 --- a/sw/libs/string_lib/src/qprintf.c +++ b/sw/libs/string_lib/src/qprintf.c @@ -220,6 +220,10 @@ static int qprint(char **out, const char *format, va_list va) pc += qprints (out, scr, width, pad); continue; } + /* for such case:"xxxx%123\0xxxxx" */ + if( *format == '\0' ) break; + /* for such case:"xxx%123%sxxx" */ + if( *format == '%' ) --format; } else {