normanr commented on a change in pull request #5108: URL: https://github.com/apache/incubator-nuttx/pull/5108#discussion_r776342120
########## File path: fs/binfs/fs_binfs.c ########## @@ -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, NAME_MAX); Review comment: Actually there's a better way, use `sizeof()`, that way seems less error prone. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org