summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal/tests/palsuite/file_io/SetCurrentDirectoryW')
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp (renamed from src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.c)2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp (renamed from src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.c)4
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.cpp (renamed from src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.c)0
6 files changed, 6 insertions, 6 deletions
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/CMakeLists.txt
index a0c1dff..9149221 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SetCurrentDirectoryW.c
+ SetCurrentDirectoryW.cpp
)
add_executable(paltest_setcurrentdirectoryw_test1
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.c b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp
index 257d016..e10f2ea 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.c
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test1/SetCurrentDirectoryW.cpp
@@ -52,7 +52,7 @@ BOOL GetCurrentDir(WCHAR* szwCurrentDir)
// now strip the file name from the full path to get the current path
nCount = lstrlenW(szwReturnedPath) - lstrlenW(szwFileName);
memset(szwCurrentDir, 0, sizeof(WCHAR)*(_MAX_DIR+1));
- lstrcpynW(szwCurrentDir, szwReturnedPath, nCount);
+ wcsncpy(szwCurrentDir, szwReturnedPath, nCount - 1);
free(szwFileName);
return(TRUE);
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/CMakeLists.txt
index a032462..455ddc8 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- setcurrentdirectoryw.c
+ setcurrentdirectoryw.cpp
)
add_executable(paltest_setcurrentdirectoryw_test2
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.c b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp
index 7e3d7b7..7f833ba 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.c
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp
@@ -63,9 +63,9 @@ int __cdecl main(int argc, char *argv[])
/* append the temp name to the "home" directory */
memset(szBuiltDir, 0, MAX_PATH);
#if WIN32
- sprintf(szBuiltDir,"%s\\..\\", szDirName);
+ sprintf_s(szBuiltDir, _countof(szBuiltDir),"%s\\..\\", szDirName);
#else
- sprintf(szBuiltDir,"%s/../", szDirName);
+ sprintf_s(szBuiltDir, _countof(szBuiltDir),"%s/../", szDirName);
#endif
szwBuiltDir = convert(szBuiltDir);
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/CMakeLists.txt
index 3b981f9..1cb1150 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- setcurrentdirectoryw.c
+ setcurrentdirectoryw.cpp
)
add_executable(paltest_setcurrentdirectoryw_test3
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.c b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.cpp
index e8c4be2..e8c4be2 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.c
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test3/setcurrentdirectoryw.cpp