sched_note: fix buffer size warning in coverity

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
This commit is contained in:
zhuyanlin 2022-03-30 20:53:48 +08:00 committed by Xiang Xiao
parent 27c80f2586
commit c46a926e2b

View File

@ -494,7 +494,7 @@ void sched_note_start(FAR struct tcb_s *tcb)
namelen = strlen(tcb->name);
DEBUGASSERT(namelen <= CONFIG_TASK_NAME_SIZE);
strncpy(note.nsa_name, tcb->name, CONFIG_TASK_NAME_SIZE + 1);
strlcpy(note.nsa_name, tcb->name, sizeof(note.nsa_name));
length = SIZEOF_NOTE_START(namelen + 1);
#else