diff --git a/lib/posix/fs.c b/lib/posix/fs.c index b20ac0d5f4e..0f0dd9dd366 100644 --- a/lib/posix/fs.c +++ b/lib/posix/fs.c @@ -249,7 +249,7 @@ struct dirent *readdir(DIR *dirp) } rc = strlen(fdirent.name); - rc = (rc < PATH_MAX) ? rc : (PATH_MAX - 1); + rc = (rc < MAX_FILE_NAME) ? rc : (MAX_FILE_NAME - 1); (void)memcpy(pdirent.d_name, fdirent.name, rc); /* Make sure the name is NULL terminated */