mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
nuttx:Change fs strncpy to strlcpy to avoid losing'\0'
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
This commit is contained in:
@@ -1779,7 +1779,7 @@ static int proc_readdir(struct fs_dirent_s *dir)
|
||||
/* Save the filename and file type */
|
||||
|
||||
dir->fd_dir.d_type = node->dtype;
|
||||
strncpy(dir->fd_dir.d_name, node->name, NAME_MAX);
|
||||
strlcpy(dir->fd_dir.d_name, node->name, sizeof(dir->fd_dir.d_name));
|
||||
|
||||
/* Set up the next directory entry offset. NOTE that we could use the
|
||||
* standard f_pos instead of our own private index.
|
||||
|
||||
Reference in New Issue
Block a user