sched/init: Fix the compiler warning
/github/workspace/sources/nuttx/include/nuttx/init.h: In function 'nx_start':
Error: init/nx_start.c:439:7: error: 'strncpy' output truncated copying 8 bytes from a string of length 9 [-Werror=stringop-truncation]
439 | strncpy(g_idletcb[i].cmn.name, g_idlename, CONFIG_TASK_NAME_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
a07dc2363e
commit
8fa26944f7
1 changed files with 1 additions and 2 deletions
|
|
@ -436,8 +436,7 @@ void nx_start(void)
|
|||
snprintf(g_idletcb[i].cmn.name, CONFIG_TASK_NAME_SIZE, "CPU%d IDLE",
|
||||
i);
|
||||
# else
|
||||
strncpy(g_idletcb[i].cmn.name, g_idlename, CONFIG_TASK_NAME_SIZE);
|
||||
g_idletcb[i].cmn.name[CONFIG_TASK_NAME_SIZE] = '\0';
|
||||
strlcpy(g_idletcb[i].cmn.name, g_idlename, CONFIG_TASK_NAME_SIZE);
|
||||
# endif
|
||||
|
||||
/* Configure the task name in the argument list. The IDLE task does
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue