From 33e35c6ce334e463e657acd84c9752fd121ab41b Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 26 Nov 2022 00:53:02 +0800 Subject: [PATCH] libc/stdio: Don't set FL_[LONG|SHORT] repeatly in vsprintf_internal Signed-off-by: Xiang Xiao --- libs/libc/stdio/lib_libvsprintf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libs/libc/stdio/lib_libvsprintf.c b/libs/libc/stdio/lib_libvsprintf.c index d69f4b473b..28657b7679 100644 --- a/libs/libc/stdio/lib_libvsprintf.c +++ b/libs/libc/stdio/lib_libvsprintf.c @@ -459,8 +459,11 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream, { flags |= FL_REPD_TYPE; } + else + { + flags |= FL_LONG; + } - flags |= FL_LONG; flags &= ~FL_SHORT; continue; } @@ -471,8 +474,11 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream, { flags |= FL_REPD_TYPE; } + else + { + flags |= FL_SHORT; + } - flags |= FL_SHORT; flags &= ~FL_LONG; continue; }