This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 44b92d9  Fix readline_common.c:277:19: error: 'strncpy' destination 
unchanged after copying no bytes
44b92d9 is described below

commit 44b92d9254d3558ad7abaad3b6d231cd7bb69d22
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Sat Mar 5 15:47:04 2022 +0800

    Fix readline_common.c:277:19: error: 'strncpy' destination unchanged after 
copying no bytes
    
    Signed-off-by: Xiang Xiao <xiaoxi...@xiaomi.com>
---
 system/readline/readline_common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/system/readline/readline_common.c 
b/system/readline/readline_common.c
index 6fdf9b5..4ddfe28 100644
--- a/system/readline/readline_common.c
+++ b/system/readline/readline_common.c
@@ -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, ' ');

Reply via email to