Fix readline_common.c:277:19: error: 'strncpy' destination unchanged after copying no bytes
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
d4290b3e93
commit
44b92d9254
@ -274,7 +274,7 @@ static void tab_completion(FAR struct rl_common_s *vtbl, char *buf,
|
||||
|
||||
if (tmp_name[0] == '\0')
|
||||
{
|
||||
strncpy(tmp_name, name, sizeof(tmp_name) - 1);
|
||||
strlcpy(tmp_name, name, sizeof(tmp_name));
|
||||
}
|
||||
|
||||
RL_PUTC(vtbl, ' ');
|
||||
@ -309,7 +309,7 @@ static void tab_completion(FAR struct rl_common_s *vtbl, char *buf,
|
||||
|
||||
if (tmp_name[0] == '\0')
|
||||
{
|
||||
strncpy(tmp_name, name, sizeof(tmp_name) - 1);
|
||||
strlcpy(tmp_name, name, sizeof(tmp_name));
|
||||
}
|
||||
|
||||
RL_PUTC(vtbl, ' ');
|
||||
|
Loading…
x
Reference in New Issue
Block a user