summaryrefslogtreecommitdiff
path: root/src/pal/tests/palsuite/file_io/SearchPathW
diff options
context:
space:
mode:
Diffstat (limited to 'src/pal/tests/palsuite/file_io/SearchPathW')
-rw-r--r--src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt2
-rw-r--r--src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp (renamed from src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.c)15
2 files changed, 6 insertions, 11 deletions
diff --git a/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt b/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt
index d0c6252472..a77d875505 100644
--- a/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/file_io/SearchPathW/test1/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 2.8.12.2)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
- SearchPathW.c
+ SearchPathW.cpp
)
add_executable(paltest_searchpathw_test1
diff --git a/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.c b/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp
index 2bc7694dc0..6880a864cb 100644
--- a/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.c
+++ b/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp
@@ -127,18 +127,13 @@ int __cdecl main(int argc, char *argv[]) {
*/
memset(fullPath, 0, _MAX_DIR);
- /* Get the full path to the library (DLL).
- */
-
- if ( NULL != _fullpath( fullPath, argv[0], _MAX_DIR )) {
- _splitpath(fullPath,drive,dir,fname,ext);
- _makepath(fullPath,drive,dir,"","");
- } else {
- Fail("ERROR: conversion from relative path \" %s \" to absolute path failed. _fullpath returned NULL\n",argv[0]);
- }
+ if (GetTempPathA(_MAX_DIR, fullPath) == 0)
+ {
+ Fail("ERROR: GetTempPathA failed to get a path\n");
+ }
memset(fileloc, 0, _MAX_PATH);
- sprintf(fileloc, "%s%s", fullPath, szFileNameExistsWithExt);
+ sprintf_s(fileloc, _countof(fileloc), "%s%s", fullPath, szFileNameExistsWithExt);
RemoveAll();