Skip to content

Commit e967120

Browse files
cfriedtkartben
authored andcommitted
tests: posix: fs: correct arguments to readdir_r()
Previously, a NULL pointer was passed as the second argument to readdir_r(). This is incorrect. The passed pointer should be to a valid, externally-allocated struct direct. Signed-off-by: Chris Friedt <[email protected]>
1 parent 4e50374 commit e967120

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/posix/fs/src/test_fs_dir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ static int test_mkdir(void)
5757
static struct dirent *readdir_wrap(DIR *dirp, bool thread_safe)
5858
{
5959
if (thread_safe) {
60-
struct dirent *entry = NULL;
60+
struct dirent entry;
6161
struct dirent *result = NULL;
6262

63-
zassert_ok(readdir_r(dirp, entry, &result));
63+
zassert_ok(readdir_r(dirp, &entry, &result));
6464

6565
return result;
6666
} else {

0 commit comments

Comments
 (0)