mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 20:08:15 +08:00
nuttx:Change fs strncpy to strlcpy to avoid losing'\0'
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
This commit is contained in:
@@ -1289,7 +1289,7 @@ static int cromfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir)
|
||||
|
||||
name = (FAR char *)cromfs_offset2addr(fs, node->cn_name);
|
||||
finfo("Entry %" PRIu32 ": %s\n", offset, name);
|
||||
strncpy(dir->fd_dir.d_name, name, NAME_MAX);
|
||||
strlcpy(dir->fd_dir.d_name, name, sizeof(dir->fd_dir.d_name));
|
||||
|
||||
switch (node->cn_mode & S_IFMT)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user