Skip to content

Commit fa8719b

Browse files
xiaoxiang781216jerpelea
authored andcommitted
Replace all strcat with strlcat
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
1 parent 6354a74 commit fa8719b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

drivers/video/max7456.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,11 +1554,11 @@ static int add_interface(FAR const char *path,
15541554
{
15551555
/* Convert @path to a directory name. */
15561556

1557-
strcat(buf, "/");
1557+
strlcat(buf, "/", sizeof(buf));
15581558

15591559
/* Append the real interface name. */
15601560

1561-
strcat(buf, name);
1561+
strlcat(buf, name, sizeof(buf));
15621562
}
15631563

15641564
/* Register the interface in the usual way. NuttX will build the

fs/hostfs/hostfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ static int hostfs_rewinddir(FAR struct inode *mountpt,
10021002
static int hostfs_bind(FAR struct inode *blkdriver, FAR const void *data,
10031003
FAR void **handle)
10041004
{
1005-
FAR struct hostfs_mountpt_s *fs;
1005+
FAR struct hostfs_mountpt_s *fs;
10061006
FAR char *options;
10071007
char *saveptr;
10081008
char *ptr;
@@ -1080,7 +1080,7 @@ static int hostfs_bind(FAR struct inode *blkdriver, FAR const void *data,
10801080

10811081
if (fs->fs_root[len - 1] != '/')
10821082
{
1083-
strcat(fs->fs_root, "/");
1083+
strlcat(fs->fs_root, "/", sizeof(fs->fs_root));
10841084
}
10851085

10861086
*handle = (FAR void *)fs;

fs/rpmsgfs/rpmsgfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,7 @@ static int rpmsgfs_bind(FAR struct inode *blkdriver, FAR const void *data,
11401140

11411141
if (fs->fs_root[len - 1] != '/')
11421142
{
1143-
strcat(fs->fs_root, "/");
1143+
strlcat(fs->fs_root, "/", sizeof(fs->fs_root));
11441144
}
11451145

11461146
*handle = (FAR void *)fs;

0 commit comments

Comments
 (0)