change strcpy to strlcpy

Change-Id: I8b9429a3c225a82842fce136bdb14b8b135066d3
Signed-off-by: lilei19 <lilei19@xiaomi.com>
This commit is contained in:
lilei19
2023-02-09 19:01:32 +08:00
committed by Xiang Xiao
parent e86745b9a2
commit 41f60bd669
33 changed files with 238 additions and 180 deletions

View File

@@ -983,7 +983,8 @@ int main(int argc, FAR char *argv[])
loop_num = CONFIG_TESTING_FSTEST_NLOOPS;
ctx->max_file = CONFIG_TESTING_FSTEST_MAXFILE;
ctx->max_open = CONFIG_TESTING_FSTEST_MAXOPEN;
strcpy(ctx->mountdir, CONFIG_TESTING_FSTEST_MOUNTPT);
strlcpy(ctx->mountdir, CONFIG_TESTING_FSTEST_MOUNTPT,
sizeof(ctx->mountdir));
/* Opt Parse */
@@ -992,7 +993,7 @@ int main(int argc, FAR char *argv[])
switch (option)
{
case 'm':
strcpy(ctx->mountdir, optarg);
strlcpy(ctx->mountdir, optarg, sizeof(ctx->mountdir));
break;
case 'h':
show_useage();

View File

@@ -2479,7 +2479,8 @@ int main(int argc, FAR char *argv[])
switch (option)
{
case 'm':
strcpy(ctx->mountdir, optarg);
strlcpy(ctx->mountdir, optarg,
sizeof(ctx->mountdir));
break;
case 'h':
show_useage();