mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
nuttx:Change fs strncpy to strlcpy to avoid losing'\0'
Signed-off-by: zhouliang3 <zhouliang3@xiaomi.com>
This commit is contained in:
+1
-1
@@ -326,7 +326,7 @@ static int binfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir)
|
||||
|
||||
finfo("Entry %d: \"%s\"\n", index, name);
|
||||
dir->fd_dir.d_type = DTYPE_FILE;
|
||||
strncpy(dir->fd_dir.d_name, name, NAME_MAX);
|
||||
strlcpy(dir->fd_dir.d_name, name, sizeof(dir->fd_dir.d_name));
|
||||
|
||||
/* The application list is terminated by an entry with a NULL name.
|
||||
* Therefore, there is at least one more entry in the list.
|
||||
|
||||
Reference in New Issue
Block a user