diff --git a/src/os/vxworks/src/os-impl-dirs.c b/src/os/vxworks/src/os-impl-dirs.c index 39dad61d8..8f2c5e01e 100644 --- a/src/os/vxworks/src/os-impl-dirs.c +++ b/src/os/vxworks/src/os-impl-dirs.c @@ -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 */