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 11:00:38 +08:00 • committed by Petro Karashchenko
parent 956b935511
commit 6aa05b5855
5 changed files with 7 additions and 7 deletions

View file

@ -89,7 +89,7 @@ int main(int argc, FAR char *argv[])
/* Set up the server address */
addrlen = strlen(CONFIG_EXAMPLES_UDGRAM_ADDR) + 1;
addrlen = sizeof(CONFIG_EXAMPLES_UDGRAM_ADDR);
if (addrlen > UNIX_PATH_MAX)
{
addrlen = UNIX_PATH_MAX;

View file

@ -91,7 +91,7 @@ int main(int argc, FAR char *argv[])
/* Bind the socket to a local address */
addrlen = strlen(CONFIG_EXAMPLES_UDGRAM_ADDR) + 1;
addrlen = sizeof(CONFIG_EXAMPLES_UDGRAM_ADDR);
if (addrlen > UNIX_PATH_MAX)
{
addrlen = UNIX_PATH_MAX;

View file

@ -78,7 +78,7 @@ int main(int argc, FAR char *argv[])
/* Connect the socket to the server */
addrlen = strlen(CONFIG_EXAMPLES_USTREAM_ADDR) + 1;
addrlen = sizeof(CONFIG_EXAMPLES_USTREAM_ADDR);
if (addrlen > UNIX_PATH_MAX)
{
addrlen = UNIX_PATH_MAX;

View file

@ -78,7 +78,7 @@ int main(int argc, char *argv[])
/* Bind the socket to a local address */
addrlen = strlen(CONFIG_EXAMPLES_USTREAM_ADDR) + 1;
addrlen = sizeof(CONFIG_EXAMPLES_USTREAM_ADDR);
if (addrlen > UNIX_PATH_MAX)
{
addrlen = UNIX_PATH_MAX;