Replace strlen with sizeof for kconfig string

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-09-01 10:58:25 +08:00 committed by Petro Karashchenko
parent 3b4ea52a79
commit 7f3a76c290
2 changed files with 3 additions and 3 deletions

View File

@ -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);

View File

@ -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)