From d706510064be474783881d69c30d8669ae7de18b Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sun, 20 Nov 2022 04:11:35 +0800 Subject: [PATCH] Fix Error: vi.c:888:57: error: format string is not a string literal (potentially insecure) Signed-off-by: Xiang Xiao --- 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);