Skip to content

Commit

Permalink
fs/procfs: fix readdir loss last character
Browse files Browse the repository at this point in the history
nsh> ls proc/fs
/proc/fs: ----> /proc/fs:
 block           blocks
 moun            mount
 usag            usage

Signed-off-by: chao an <anchao@xiaomi.com>
  • Loading branch information
anchao authored and xiaoxiang781216 committed Apr 23, 2023
1 parent 50488ac commit 13cdffd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/procfs/fs_procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ static int procfs_readdir(FAR struct inode *mountpt,
pathpattern[level1->subdirlen + 1];
level1->lastlen = strcspn(name, "/");
level1->lastread = name;
strlcpy(entry->d_name, name, level1->lastlen);
strlcpy(entry->d_name, name, level1->lastlen + 1);

/* Some of the search entries contain '**' wildcards. When we
* report the entry name, we must remove this wildcard search
Expand Down

0 comments on commit 13cdffd

Please sign in to comment.