This is an automated email from the ASF dual-hosted git repository.

archer pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit d706510064be474783881d69c30d8669ae7de18b
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Sun Nov 20 04:11:35 2022 +0800

    Fix Error: vi.c:888:57: error: format string is not a string literal 
(potentially insecure)
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 system/vi/vi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/system/vi/vi.c b/system/vi/vi.c
index 7baff382d..0b23da4fb 100644
--- a/system/vi/vi.c
+++ b/system/vi/vi.c
@@ -885,7 +885,7 @@ static void vi_printf(FAR struct vi_s *vi, FAR const char 
*prefix,
 
   /* Expand the prefix message in the scratch buffer */
 
-  len = prefix ? snprintf(vi->scratch, SCRATCH_BUFSIZE, prefix) : 0;
+  len = prefix ? snprintf(vi->scratch, SCRATCH_BUFSIZE, "%s", prefix) : 0;
 
   va_start(ap, fmt);
   len += vsnprintf(vi->scratch + len, SCRATCH_BUFSIZE - len, fmt, ap);

Reply via email to