Fix Error: vi.c:888:57: error: format string is not a string literal (potentially insecure)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-11-20 04:11:35 +08:00 committed by archer
parent bb24794fcb
commit d706510064

View File

@ -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);