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

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


The following commit(s) were added to refs/heads/master by this push:
     new 7f3a76c290 Replace strlen with sizeof for kconfig string
7f3a76c290 is described below

commit 7f3a76c2907e76a108357ed7721161cf2aeb0830
Author: Xiang Xiao <[email protected]>
AuthorDate: Fri Sep 1 10:58:25 2023 +0800

    Replace strlen with sizeof for kconfig string
    
    Signed-off-by: Xiang Xiao <[email protected]>
---
 boards/arm/rp2040/common/src/rp2040_common_bringup.c | 2 +-
 net/local/local_fifo.c                               | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/boards/arm/rp2040/common/src/rp2040_common_bringup.c 
b/boards/arm/rp2040/common/src/rp2040_common_bringup.c
index 516d47658d..7fdc2d89fc 100644
--- a/boards/arm/rp2040/common/src/rp2040_common_bringup.c
+++ b/boards/arm/rp2040/common/src/rp2040_common_bringup.c
@@ -616,7 +616,7 @@ int rp2040_common_bringup(void)
         {
           syslog(LOG_ERR, "ERROR: smart_initialize failed: %d\n", -ret);
         }
-      else if (strlen(CONFIG_RP2040_FLASH_MOUNT_POINT) > 0)
+      else if (sizeof(CONFIG_RP2040_FLASH_MOUNT_POINT) > 1)
         {
           mkdir(CONFIG_RP2040_FLASH_MOUNT_POINT, 0777);
 
diff --git a/net/local/local_fifo.c b/net/local/local_fifo.c
index 7174857054..363f22b0bc 100644
--- a/net/local/local_fifo.c
+++ b/net/local/local_fifo.c
@@ -68,9 +68,9 @@ static void local_format_name(FAR const char *inpath, FAR 
char *outpath,
                               FAR const char *suffix, int32_t id)
 {
   if (strncmp(inpath, CONFIG_NET_LOCAL_VFS_PATH,
-              strlen(CONFIG_NET_LOCAL_VFS_PATH)) == 0)
+              sizeof(CONFIG_NET_LOCAL_VFS_PATH) - 1) == 0)
     {
-      inpath += strlen(CONFIG_NET_LOCAL_VFS_PATH);
+      inpath += sizeof(CONFIG_NET_LOCAL_VFS_PATH) - 1;
     }
 
   if (id < 0)

Reply via email to