You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/07/20 16:10:51 UTC

[incubator-nuttx] 02/02: tools/mksyscall: Fix warning: '__builtin_strncpy' specified bound 256 equals destination size

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

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

commit 5ce84693d3ce28b07f7405210de05e983a6f250c
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Jul 20 17:46:03 2020 +0800

    tools/mksyscall: Fix warning: '__builtin_strncpy' specified bound 256 equals destination size
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 tools/mksyscall.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/mksyscall.c b/tools/mksyscall.c
index 5444d2b..4ad0b87 100644
--- a/tools/mksyscall.c
+++ b/tools/mksyscall.c
@@ -158,7 +158,7 @@ static void get_fieldname(const char *arg, char *fieldname)
            */
 
           pstart++;
-          strncpy(fieldname, pstart, MAX_PARMSIZE);
+          strncpy(fieldname, pstart, MAX_PARMSIZE - 1);
           return;
         }
     }