Replace all strcat with strlcat
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
6354a742f1
commit
fa8719bb5a
@ -1554,11 +1554,11 @@ static int add_interface(FAR const char *path,
|
||||
{
|
||||
/* Convert @path to a directory name. */
|
||||
|
||||
strcat(buf, "/");
|
||||
strlcat(buf, "/", sizeof(buf));
|
||||
|
||||
/* Append the real interface name. */
|
||||
|
||||
strcat(buf, name);
|
||||
strlcat(buf, name, sizeof(buf));
|
||||
}
|
||||
|
||||
/* Register the interface in the usual way. NuttX will build the
|
||||
|
@ -1002,7 +1002,7 @@ static int hostfs_rewinddir(FAR struct inode *mountpt,
|
||||
static int hostfs_bind(FAR struct inode *blkdriver, FAR const void *data,
|
||||
FAR void **handle)
|
||||
{
|
||||
FAR struct hostfs_mountpt_s *fs;
|
||||
FAR struct hostfs_mountpt_s *fs;
|
||||
FAR char *options;
|
||||
char *saveptr;
|
||||
char *ptr;
|
||||
@ -1080,7 +1080,7 @@ static int hostfs_bind(FAR struct inode *blkdriver, FAR const void *data,
|
||||
|
||||
if (fs->fs_root[len - 1] != '/')
|
||||
{
|
||||
strcat(fs->fs_root, "/");
|
||||
strlcat(fs->fs_root, "/", sizeof(fs->fs_root));
|
||||
}
|
||||
|
||||
*handle = (FAR void *)fs;
|
||||
|
@ -1140,7 +1140,7 @@ static int rpmsgfs_bind(FAR struct inode *blkdriver, FAR const void *data,
|
||||
|
||||
if (fs->fs_root[len - 1] != '/')
|
||||
{
|
||||
strcat(fs->fs_root, "/");
|
||||
strlcat(fs->fs_root, "/", sizeof(fs->fs_root));
|
||||
}
|
||||
|
||||
*handle = (FAR void *)fs;
|
||||
|
Loading…
Reference in New Issue
Block a user