Skip to content

Commit

Permalink
HOTFIX: correct UT issue with Dir Name Size
Browse files Browse the repository at this point in the history
  • Loading branch information
jphickey authored and Gerardo E. Cruz-Ortiz committed Apr 30, 2020
1 parent 7a7e6d1 commit fffaad4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/os/vxworks/src/os-impl-dirs.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ int32 OS_DirRead_Impl(uint32 local_id, os_dirent_t *dirent)
return OS_FS_ERROR;
}

strncpy(dirent->FileName, de->d_name, OS_MAX_PATH_LEN - 1);
dirent->FileName[OS_MAX_PATH_LEN - 1] = 0;
strncpy(dirent->FileName, de->d_name, sizeof(dirent->FileName)-1);
dirent->FileName[sizeof(dirent->FileName)-1] = 0;

return OS_FS_SUCCESS;
} /* end OS_DirRead_Impl */
Expand Down

0 comments on commit fffaad4

Please sign in to comment.