summaryrefslogtreecommitdiff
path: root/src/pal
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2016-12-09 00:51:19 +0100
committerGitHub <noreply@github.com>2016-12-09 00:51:19 +0100
commite58e3c5e0a527802bd5286c537dc3ed603317c1d (patch)
treedabb0caf55c65bfe141a91de2c64a4c22a3682c5 /src/pal
parentbf4ed11eb5cee7123fd0c6fa5b60f09fe7adf23e (diff)
downloadcoreclr-e58e3c5e0a527802bd5286c537dc3ed603317c1d.tar.gz
coreclr-e58e3c5e0a527802bd5286c537dc3ed603317c1d.tar.bz2
coreclr-e58e3c5e0a527802bd5286c537dc3ed603317c1d.zip
Remove sscanf and sprintf usage (#8508)
* Remove sscanf * Remove sprintf
Diffstat (limited to 'src/pal')
-rw-r--r--src/pal/inc/pal.h5
-rw-r--r--src/pal/inc/rt/palrt.h1
-rw-r--r--src/pal/src/CMakeLists.txt4
-rw-r--r--src/pal/src/cruntime/printf.cpp57
-rw-r--r--src/pal/src/debug/debug.cpp2
-rw-r--r--src/pal/src/exception/machmessage.h2
-rw-r--r--src/pal/src/include/pal/palinternal.h2
-rw-r--r--src/pal/src/safecrt/input.inl4
-rw-r--r--src/pal/src/safecrt/mbusafecrt.cpp7
-rw-r--r--src/pal/src/safecrt/sprintf_s.cpp (renamed from src/pal/src/safecrt/sprintf.cpp)2
-rw-r--r--src/pal/src/safecrt/sscanf_s.cpp (renamed from src/pal/src/safecrt/sscanf.cpp)2
-rw-r--r--src/pal/src/thread/process.cpp10
-rw-r--r--src/pal/tests/palsuite/c_runtime/CMakeLists.txt4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test5/CMakeLists.txt19
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test5/test5.cpp62
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf/test5/testinfo.dat12
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/CMakeLists.txt)1
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h (renamed from src/pal/tests/palsuite/c_runtime/sprintf/sprintf.h)32
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test1/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test1/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test1/test1.cpp)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test1/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test1/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test10/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test10/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test10/test10.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test10/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test10/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test11/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test11/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test11/test11.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test11/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test11/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test12/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test12/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test12/test12.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test12/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test12/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test13/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test13/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test13/test13.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test13/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test13/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test14/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test14/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test14/test14.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test14/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test14/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test15/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test15/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test15/test15.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test15/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test15/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test16/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test16/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test16/test16.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test16/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test16/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test17/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test17/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test17/test17.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test17/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test17/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test18/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test18/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test18/test18.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test18/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test18/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test19/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test19/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test19/test19.cpp)11
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test19/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test19/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test2/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test2/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test2/test2.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test2/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test2/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test3/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test3/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test3/test3.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test3/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test3/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test4/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test4/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test4/test4.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test4/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test4/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test6/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test6/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test6/test6.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test6/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test6/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test7/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test7/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test7/test7.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test7/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test7/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test8/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test8/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test8/test8.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test8/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test8/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test9/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test9/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test9/test9.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sprintf_s/test9/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test9/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h (renamed from src/pal/tests/palsuite/c_runtime/sscanf/sscanf.h)48
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test1/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test1/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test1/test1.cpp)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test1/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test1/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test10/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test10/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test10/test10.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test10/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test10/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test11/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test11/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test11/test11.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test11/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test11/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test12/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test12/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test12/test12.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test12/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test12/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test13/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test13/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test13/test13.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test13/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test13/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test14/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test14/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test14/test14.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test14/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test14/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test15/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test15/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test15/test15.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test15/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test15/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test16/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test16/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test16/test16.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test16/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test16/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test17/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test17/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test17/test17.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test17/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test17/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test2/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test2/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test2/test2.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test2/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test2/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test3/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test3/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test3/test3.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test3/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test3/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test4/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test4/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test4/test4.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test4/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test4/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test5/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test5/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test5/test5.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test5/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test5/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test6/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test6/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test6/test6.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test6/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test6/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test7/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test7/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test7/test7.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test7/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test7/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test8/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test8/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test8/test8.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test8/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sprintf/test8/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test9/CMakeLists.txt (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test9/CMakeLists.txt)0
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test9/test9.cpp)4
-rw-r--r--src/pal/tests/palsuite/c_runtime/sscanf_s/test9/testinfo.dat (renamed from src/pal/tests/palsuite/c_runtime/sscanf/test9/testinfo.dat)6
-rw-r--r--src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h4
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp4
-rw-r--r--src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp4
-rw-r--r--src/pal/tests/palsuite/common/palsuite.h2
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp2
-rw-r--r--src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp2
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.cpp2
-rw-r--r--src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.cpp2
-rw-r--r--src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp4
-rw-r--r--src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp4
-rw-r--r--src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp2
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.cpp28
-rw-r--r--src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.cpp28
-rw-r--r--src/pal/tests/palsuite/file_io/RemoveDirectoryA/test1/RemoveDirectoryA.cpp12
-rw-r--r--src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.cpp4
-rw-r--r--src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp2
-rw-r--r--src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp2
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.cpp4
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.cpp4
-rw-r--r--src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp4
-rw-r--r--src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/test2.cpp4
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp4
-rw-r--r--src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp4
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp2
-rw-r--r--src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp2
-rw-r--r--src/pal/tests/palsuite/paltestlist.txt71
-rw-r--r--src/pal/tests/palsuite/palverify.dat71
153 files changed, 375 insertions, 544 deletions
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h
index ba3cb245f3..28c6278ece 100644
--- a/src/pal/inc/pal.h
+++ b/src/pal/inc/pal.h
@@ -5679,9 +5679,7 @@ CoCreateGuid(OUT GUID * pguid);
#define printf PAL_printf
#define vprintf PAL_vprintf
#define wprintf PAL_wprintf
-#define sprintf PAL_sprintf
#define swprintf PAL_swprintf
-#define sscanf PAL_sscanf
#define wcsspn PAL_wcsspn
#define wcstod PAL_wcstod
#define wcstol PAL_wcstol
@@ -5850,9 +5848,7 @@ PALIMPORT char * __cdecl strstr(const char *, const char *);
PALIMPORT char * __cdecl strtok(char *, const char *);
PALIMPORT size_t __cdecl strspn(const char *, const char *);
PALIMPORT size_t __cdecl strcspn(const char *, const char *);
-PALIMPORT int __cdecl sprintf(char *, const char *, ...);
PALIMPORT int __cdecl vsprintf(char *, const char *, va_list);
-PALIMPORT int __cdecl sscanf(const char *, const char *, ...);
PALIMPORT int __cdecl atoi(const char *);
PALIMPORT LONG __cdecl atol(const char *);
PALIMPORT ULONG __cdecl strtoul(const char *, char **, int);
@@ -5898,6 +5894,7 @@ PALIMPORT int __cdecl sprintf_s(char *, size_t, const char *, ... );
PALIMPORT int __cdecl swprintf_s(WCHAR *, size_t, const WCHAR *, ... );
PALIMPORT int __cdecl _snwprintf_s(WCHAR *, size_t, size_t, const WCHAR *, ...);
PALIMPORT int __cdecl vswprintf_s( WCHAR *, size_t, const WCHAR *, va_list);
+PALIMPORT int __cdecl sscanf_s(const char *, const char *, ...);
PALIMPORT errno_t __cdecl _itow_s(int, WCHAR *, size_t, int);
PALIMPORT size_t __cdecl PAL_wcslen(const WCHAR *);
diff --git a/src/pal/inc/rt/palrt.h b/src/pal/inc/rt/palrt.h
index ab46f21efc..c181f38c2b 100644
--- a/src/pal/inc/rt/palrt.h
+++ b/src/pal/inc/rt/palrt.h
@@ -895,7 +895,6 @@ Remember to fix the errcode defintion in safecrt.h.
#define _wcslwr_s _wcslwr_unsafe
#define _snprintf_s _snprintf_unsafe
#define swscanf_s swscanf
-#define sscanf_s sscanf
#define _wfopen_s _wfopen_unsafe
#define fopen_s _fopen_unsafe
diff --git a/src/pal/src/CMakeLists.txt b/src/pal/src/CMakeLists.txt
index 0f91edb150..28ee83a77c 100644
--- a/src/pal/src/CMakeLists.txt
+++ b/src/pal/src/CMakeLists.txt
@@ -186,8 +186,8 @@ set(SOURCES
safecrt/safecrt_winput_s.cpp
safecrt/safecrt_woutput_s.cpp
safecrt/splitpath_s.cpp
- safecrt/sprintf.cpp
- safecrt/sscanf.cpp
+ safecrt/sprintf_s.cpp
+ safecrt/sscanf_s.cpp
safecrt/strcat_s.cpp
safecrt/strcpy_s.cpp
safecrt/strlen_s.cpp
diff --git a/src/pal/src/cruntime/printf.cpp b/src/pal/src/cruntime/printf.cpp
index 83964183b2..c437b8e39f 100644
--- a/src/pal/src/cruntime/printf.cpp
+++ b/src/pal/src/cruntime/printf.cpp
@@ -1365,63 +1365,6 @@ int PAL_wvsscanf(LPCWSTR Buffer, LPCWSTR Format, va_list ap)
/*++
Function:
- PAL_sscanf
-
-See MSDN doc.
---*/
-int
-__cdecl
-PAL_sscanf(
- const char *buffer,
- const char *format,
- ...)
-{
- int Length;
- va_list ap;
-
- PERF_ENTRY(sscanf);
- ENTRY("PAL_sscanf (buffer=%p (%s), format=%p (%s))\n", buffer, buffer, format, format);
-
- va_start(ap, format);
- Length = PAL_vsscanf(buffer, format, ap);
- va_end(ap);
-
- LOGEXIT("PAL_sscanf returns int %d\n", Length);
- PERF_EXIT(sscanf);
- return Length;
-}
-
-/*++
-Function:
- PAL_sprintf
-
-See MSDN doc.
---*/
-int
-__cdecl
-PAL_sprintf(
- char *buffer,
- const char *format,
- ...)
-{
- LONG Length;
- va_list ap;
-
- PERF_ENTRY(sprintf);
- ENTRY("PAL_sprintf (buffer=%p, format=%p (%s))\n", buffer, format, format);
-
- va_start(ap, format);
- Length = InternalVsnprintf(CorUnix::InternalGetCurrentThread(), buffer, 0x7fffffff, format, ap);
- va_end(ap);
-
- LOGEXIT("PAL_sprintf returns int %d\n", Length);
- PERF_EXIT(sprintf);
- return Length;
-}
-
-
-/*++
-Function:
PAL_swprintf
See MSDN doc.
diff --git a/src/pal/src/debug/debug.cpp b/src/pal/src/debug/debug.cpp
index 5461ac6265..756e615d66 100644
--- a/src/pal/src/debug/debug.cpp
+++ b/src/pal/src/debug/debug.cpp
@@ -857,7 +857,7 @@ DBGDetachProcess(
if (nbAttachLeft == 0)
{
#if HAVE_PROCFS_CTL
- sprintf(ctlPath, sizeof(ctlPath), "/proc/%d/ctl", processId);
+ snprintf(ctlPath, sizeof(ctlPath), "/proc/%d/ctl", processId);
fd = InternalOpen(pThread, ctlPath, O_WRONLY);
if (fd == -1)
{
diff --git a/src/pal/src/exception/machmessage.h b/src/pal/src/exception/machmessage.h
index 46c09b8f37..abc583f6c4 100644
--- a/src/pal/src/exception/machmessage.h
+++ b/src/pal/src/exception/machmessage.h
@@ -36,7 +36,7 @@ using namespace CorUnix;
if (machret != KERN_SUCCESS) \
{ \
char _szError[1024]; \
- sprintf(_szError, "%s: %u: %s", __FUNCTION__, __LINE__, _msg); \
+ snprintf(_szError, _countof(_szError), "%s: %u: %s", __FUNCTION__, __LINE__, _msg); \
mach_error(_szError, machret); \
abort(); \
} \
diff --git a/src/pal/src/include/pal/palinternal.h b/src/pal/src/include/pal/palinternal.h
index 44f2528991..f7856be902 100644
--- a/src/pal/src/include/pal/palinternal.h
+++ b/src/pal/src/include/pal/palinternal.h
@@ -502,9 +502,7 @@ function_name() to call the system's implementation
#undef vfwprintf
#undef vprintf
#undef wprintf
-#undef sprintf
#undef swprintf
-#undef sscanf
#undef wcstod
#undef wcstol
#undef wcstoul
diff --git a/src/pal/src/safecrt/input.inl b/src/pal/src/safecrt/input.inl
index eaad174ff5..25c4541029 100644
--- a/src/pal/src/safecrt/input.inl
+++ b/src/pal/src/safecrt/input.inl
@@ -671,7 +671,7 @@ scanit:
#endif /* _SECURE_SCANF */
#ifndef _UNICODE
if (fl_wchar_arg) {
- wctemp = L'?';
+ wctemp = W('?');
char temp[2];
temp[0] = (char) ch;
#if 0 // we are not supporting multibyte input strings
@@ -682,7 +682,7 @@ scanit:
#endif /* 0 */
_MBTOWC(&wctemp, temp, MB_CUR_MAX);
*(wchar_t UNALIGNED *)pointer = wctemp;
- /* just copy L'?' if mbtowc fails, errno is set by mbtowc */
+ /* just copy W('?') if mbtowc fails, errno is set by mbtowc */
pointer = (wchar_t *)pointer + 1;
#ifdef _SECURE_SCANF
--array_width;
diff --git a/src/pal/src/safecrt/mbusafecrt.cpp b/src/pal/src/safecrt/mbusafecrt.cpp
index 9b3ffd599c..4446f77fd1 100644
--- a/src/pal/src/safecrt/mbusafecrt.cpp
+++ b/src/pal/src/safecrt/mbusafecrt.cpp
@@ -147,7 +147,6 @@ int _ungetwc_nolock( wchar_t inChar, miniFILE* inStream )
/***
* _safecrt_cfltcvt - convert a float to an ascii string.
-* Uses sprintf - this usage is OK.
****/
/* routine used for floating-point output */
@@ -197,14 +196,12 @@ void _safecrt_fassign(int flag, void* argument, char* number )
{
if ( flag != 0 ) // double
{
- double dblValue = 0.0;
- (void)sscanf( number, "%lf", &dblValue );
+ double dblValue = strtod(number, NULL);
*( ( double* )argument ) = dblValue;
}
else // float
{
- float fltValue = 0.0;
- (void)sscanf( number, "%f", &fltValue );
+ float fltValue = strtof(number, NULL);
*( ( float* )argument ) = fltValue;
}
}
diff --git a/src/pal/src/safecrt/sprintf.cpp b/src/pal/src/safecrt/sprintf_s.cpp
index 8a51d2644e..edfb768670 100644
--- a/src/pal/src/safecrt/sprintf.cpp
+++ b/src/pal/src/safecrt/sprintf_s.cpp
@@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.
/***
-*sprintf.c - print formatted to string
+*sprintf_s.c - print formatted to string
*
*
diff --git a/src/pal/src/safecrt/sscanf.cpp b/src/pal/src/safecrt/sscanf_s.cpp
index d6c21e8eca..4f548bccc6 100644
--- a/src/pal/src/safecrt/sscanf.cpp
+++ b/src/pal/src/safecrt/sscanf_s.cpp
@@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.
/***
-*sscanf.c - read formatted data from string
+*sscanf_s.c - read formatted data from string
*
*
diff --git a/src/pal/src/thread/process.cpp b/src/pal/src/thread/process.cpp
index c57d604e9c..a64bfb8ab1 100644
--- a/src/pal/src/thread/process.cpp
+++ b/src/pal/src/thread/process.cpp
@@ -2049,18 +2049,18 @@ GetProcessIdDisambiguationKey(DWORD processId, UINT64 *disambiguationKey)
// According to `man proc`, the second field in the stat file is the filename of the executable,
// in parentheses. Tokenizing the stat file using spaces as separators breaks when that name
- // has spaces in it, so we start using sscanf after skipping everything up to and including the
+ // has spaces in it, so we start using sscanf_s after skipping everything up to and including the
// last closing paren and the space after it.
char *scanStartPosition = strrchr(line, ')') + 2;
// All the format specifiers for the fields in the stat file are provided by 'man proc'.
- int sscanfRet = sscanf(scanStartPosition,
+ int sscanfRet = sscanf_s(scanStartPosition,
"%*c %*d %*d %*d %*d %*d %*u %*lu %*lu %*lu %*lu %*lu %*lu %*ld %*ld %*ld %*ld %*ld %*ld %llu \n",
&starttime);
if (sscanfRet != 1)
{
- _ASSERTE(!"Failed to parse stat file contents with sscanf.");
+ _ASSERTE(!"Failed to parse stat file contents with sscanf_s.");
return FALSE;
}
@@ -2690,7 +2690,7 @@ CreateProcessModules(
char moduleName[PATH_MAX];
int size;
- if (sscanf(line, "__TEXT %p-%p [ %dK] %*[-/rwxsp] SM=%*[A-Z] %s\n", &startAddress, &endAddress, &size, moduleName) == 4)
+ if (sscanf_s(line, "__TEXT %p-%p [ %dK] %*[-/rwxsp] SM=%*[A-Z] %s\n", &startAddress, &endAddress, &size, moduleName, _countof(moduleName)) == 4)
{
bool dup = false;
for (ProcessModules *entry = listHead; entry != NULL; entry = entry->Next)
@@ -2768,7 +2768,7 @@ exit:
int devHi, devLo, inode;
char moduleName[PATH_MAX];
- if (sscanf(line, "%p-%p %*[-rwxsp] %p %x:%x %d %s\n", &startAddress, &endAddress, &offset, &devHi, &devLo, &inode, moduleName) == 7)
+ if (sscanf_s(line, "%p-%p %*[-rwxsp] %p %x:%x %d %s\n", &startAddress, &endAddress, &offset, &devHi, &devLo, &inode, moduleName, _countof(moduleName)) == 7)
{
if (inode != 0)
{
diff --git a/src/pal/tests/palsuite/c_runtime/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/CMakeLists.txt
index d2da52785e..cf062530eb 100644
--- a/src/pal/tests/palsuite/c_runtime/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/CMakeLists.txt
@@ -86,10 +86,10 @@ add_subdirectory(sin)
add_subdirectory(sinf)
add_subdirectory(sinh)
add_subdirectory(sinhf)
-add_subdirectory(sprintf)
+add_subdirectory(sprintf_s)
add_subdirectory(sqrt)
add_subdirectory(sqrtf)
-add_subdirectory(sscanf)
+add_subdirectory(sscanf_s)
add_subdirectory(strcat)
add_subdirectory(strchr)
add_subdirectory(strcmp)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf/test5/CMakeLists.txt
deleted file mode 100644
index 5d7ce6cb6d..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test5/CMakeLists.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-cmake_minimum_required(VERSION 2.8.12.2)
-
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-set(SOURCES
- test5.cpp
-)
-
-add_executable(paltest_sprintf_test5
- ${SOURCES}
-)
-
-add_dependencies(paltest_sprintf_test5 coreclrpal)
-
-target_link_libraries(paltest_sprintf_test5
- pthread
- m
- coreclrpal
-)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test5/test5.cpp b/src/pal/tests/palsuite/c_runtime/sprintf/test5/test5.cpp
deleted file mode 100644
index 1b52da77b6..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test5/test5.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-
-/*============================================================================
-**
-** Source: test5.c
-**
-** Purpose: Test #5 for the sprintf function. Tests the count specifier (%n).
-**
-**
-**==========================================================================*/
-
-
-
-#include <palsuite.h>
-#include "../sprintf.h"
-
-/*
- * Depends on memcmp and strlen
- */
-
-
-int __cdecl main(int argc, char *argv[])
-{
- char *longStr =
- "really-long-string-that-just-keeps-going-on-and-on-and-on.."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "%n bar";
- char *longResult =
- "really-long-string-that-just-keeps-going-on-and-on-and-on.."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- "..................useless-filler.................................."
- " bar";
-
- if (PAL_Initialize(argc, argv)!= 0)
- {
- return FAIL;
- }
-
- DoCountTest("foo %n bar", 4, "foo bar");
- DoCountTest(longStr, 257, longResult);
- DoCountTest("fo%n bar", 2, "fo bar");
- DoCountTest("%n", 0, "");
- DoCountTest("foo %#n bar", 4, "foo bar");
- DoCountTest("foo % n bar", 4, "foo bar");
- DoCountTest("foo %+n bar", 4, "foo bar");
- DoCountTest("foo %-n bar", 4, "foo bar");
- DoCountTest("foo %0n bar", 4, "foo bar");
- DoShortCountTest("foo %hn bar", 4, "foo bar");
- DoCountTest("foo %ln bar", 4, "foo bar");
- DoCountTest("foo %Ln bar", 4, "foo bar");
- DoCountTest("foo %I64n bar", 4, "foo bar");
- DoCountTest("foo %20.3n bar", 4, "foo bar");
-
- PAL_Terminate();
-
- return PASS;
-}
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test5/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf/test5/testinfo.dat
deleted file mode 100644
index 31e0537bd0..0000000000
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test5/testinfo.dat
+++ /dev/null
@@ -1,12 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-Version = 1.0
-Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
-TYPE = DEFAULT
-EXE1 = test5
-Description
-= Tests sprintf with the count specifier
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/CMakeLists.txt
index cafb9536b0..8fe1cb60ac 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/CMakeLists.txt
@@ -14,7 +14,6 @@ add_subdirectory(test19)
add_subdirectory(test2)
add_subdirectory(test3)
add_subdirectory(test4)
-add_subdirectory(test5)
add_subdirectory(test6)
add_subdirectory(test7)
add_subdirectory(test8)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/sprintf.h b/src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h
index 6ec4a4d591..129b9db727 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/sprintf.h
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/sprintf_s.h
@@ -4,21 +4,21 @@
/*============================================================================
**
-** Source: sprintf.h
+** Source: sprintf_s.h
**
-** Purpose: Containts common testing functions for sprintf
+** Purpose: Containts common testing functions for sprintf_s
**
**
**==========================================================================*/
-#ifndef __SPRINTF_H__
-#define __SPRINTF_H__
+#ifndef __SPRINTF_S_H__
+#define __SPRINTF_S_H__
void DoStrTest(const char *formatstr, char* param, const char *checkstr)
{
char buf[256] = { 0 };
- sprintf(buf, formatstr, param);
+ sprintf_s(buf, _countof(buf), formatstr, param);
if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
{
Fail("ERROR: failed to insert string \"%s\" into \"%s\"\n"
@@ -31,7 +31,7 @@ void DoWStrTest(const char *formatstr, WCHAR* param, const char *checkstr)
{
char buf[256] = { 0 };
- sprintf(buf, formatstr, param);
+ sprintf_s(buf, _countof(buf), formatstr, param);
if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
{
Fail("ERROR: failed to insert wide string \"%s\" into \"%s\"\n"
@@ -45,7 +45,7 @@ void DoPointerTest(const char *formatstr, void* param, char* paramstr,
{
char buf[256] = { 0 };
- sprintf(buf, formatstr, param);
+ sprintf_s(buf, _countof(buf), formatstr, param);
if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0)
{
Fail("ERROR: failed to insert %s into \"%s\"\n"
@@ -59,7 +59,7 @@ void DoCountTest(const char *formatstr, int param, const char *checkstr)
char buf[512] = { 0 };
int n = -1;
- sprintf(buf, formatstr, &n);
+ sprintf_s(buf, _countof(buf), formatstr, &n);
if (n != param)
{
@@ -77,7 +77,7 @@ void DoShortCountTest(const char *formatstr, int param, const char *checkstr)
char buf[256] = { 0 };
short int n = -1;
- sprintf(buf, formatstr, &n);
+ sprintf_s(buf, _countof(buf), formatstr, &n);
if (n != param)
{
@@ -95,7 +95,7 @@ void DoCharTest(const char *formatstr, char param, const char *checkstr)
{
char buf[256] = { 0 };
- sprintf(buf, formatstr, param);
+ sprintf_s(buf, _countof(buf), formatstr, param);
if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
{
Fail("ERROR: failed to insert char \'%c\' (%d) into \"%s\"\n"
@@ -108,7 +108,7 @@ void DoWCharTest(const char *formatstr, WCHAR param, const char *checkstr)
{
char buf[256] = { 0 };
- sprintf(buf, formatstr, param);
+ sprintf_s(buf, _countof(buf), formatstr, param);
if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
{
Fail("ERROR: failed to insert wide char \'%c\' (%d) into \"%s\"\n"
@@ -121,7 +121,7 @@ void DoNumTest(const char *formatstr, int value, const char *checkstr)
{
char buf[256] = { 0 };
- sprintf(buf, formatstr, value);
+ sprintf_s(buf, _countof(buf), formatstr, value);
if (memcmp(buf, checkstr, strlen(checkstr) + 1) != 0)
{
Fail("ERROR: failed to insert %#x into \"%s\"\n"
@@ -134,7 +134,7 @@ void DoI64Test(const char *formatstr, INT64 value, char *valuestr, const char *c
{
char buf[256] = { 0 };
- sprintf(buf, formatstr, value);
+ sprintf_s(buf, _countof(buf), formatstr, value);
if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0)
{
Fail("ERROR: failed to insert %s into \"%s\"\n"
@@ -148,7 +148,7 @@ void DoDoubleTest(const char *formatstr, double value, const char *checkstr1,
{
char buf[256] = { 0 };
- sprintf(buf, formatstr, value);
+ sprintf_s(buf, _countof(buf), formatstr, value);
if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
{
@@ -163,7 +163,7 @@ void DoArgumentPrecTest(const char *formatstr, int precision, void *param,
{
char buf[256];
- sprintf(buf, formatstr, precision, param);
+ sprintf_s(buf, _countof(buf), formatstr, precision, param);
if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
{
@@ -179,7 +179,7 @@ void DoArgumentPrecDoubleTest(const char *formatstr, int precision, double param
{
char buf[256];
- sprintf(buf, formatstr, precision, param);
+ sprintf_s(buf, _countof(buf), formatstr, precision, param);
if (memcmp(buf, checkstr1, strlen(checkstr1) + 1) != 0 &&
memcmp(buf, checkstr2, strlen(checkstr2) + 1) != 0)
{
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/CMakeLists.txt
index ee0d90fe7f..ee0d90fe7f 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp
index 42e27f263b..a289c07716 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test1/test1.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/test1.cpp
@@ -6,7 +6,7 @@
**
** Source: test1.c
**
-** Purpose: Test #1 for the sprintf function. A single, basic, test
+** Purpose: Test #1 for the sprintf_s function. A single, basic, test
** case with no formatting.
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
@@ -32,7 +32,7 @@ int __cdecl main(int argc, char *argv[])
}
- sprintf(buf, "hello world");
+ sprintf_s(buf, _countof(buf), "hello world");
if (memcmp(checkstr, buf, strlen(checkstr)+1) != 0)
{
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/testinfo.dat
index abe07445cc..255c534cdf 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test1/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test1/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test1
Description
-= General test to see if sprintf works correctly
+= General test to see if sprintf_s works correctly
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/CMakeLists.txt
index 1efad19dee..1efad19dee 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test10/test10.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp
index ae7dbfb177..bbda15a331 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test10/test10.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/test10.cpp
@@ -6,7 +6,7 @@
**
** Source: test10.c
**
-** Purpose: Test #10 for the sprintf function. Tests the octal specifier
+** Purpose: Test #10 for the sprintf_s function. Tests the octal specifier
** (%o).
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/testinfo.dat
index 70b7f3ab75..25ed554ea3 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test10/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test10/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test10
Description
-= Tests sprintf with octal numbers
+= Tests sprintf_s with octal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/CMakeLists.txt
index f2f4da694c..f2f4da694c 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test11/test11.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp
index 0b5b5ab93d..7f4fca9f32 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test11/test11.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/test11.cpp
@@ -6,7 +6,7 @@
**
** Source: test11.c
**
-** Purpose: Test #11 for the sprintf function. Test the unsigned int
+** Purpose: Test #11 for the sprintf_s function. Test the unsigned int
** specifier (%u).
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/testinfo.dat
index 852bd3e7b6..3144f1290e 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test11/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test11/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test11
Description
-= Tests sprintf with unsigned numbers
+= Tests sprintf_s with unsigned numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/CMakeLists.txt
index 361e91f9ae..361e91f9ae 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test12/test12.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp
index c2e778e494..759a41105b 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test12/test12.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/test12.cpp
@@ -6,7 +6,7 @@
**
** Source: test12.c
**
-** Purpose: Test #12 for the sprintf function. Tests the (lowercase)
+** Purpose: Test #12 for the sprintf_s function. Tests the (lowercase)
** hexadecimal specifier (%x)
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/testinfo.dat
index 5df91d0e6a..ed91cecc46 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test12/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test12/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test12
Description
-= Tests sprintf with hex numbers (lowercase)
+= Tests sprintf_s with hex numbers (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/CMakeLists.txt
index d08e13b2ba..d08e13b2ba 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test13/test13.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp
index 0b4b7ed9ae..76250d058c 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test13/test13.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/test13.cpp
@@ -6,7 +6,7 @@
**
** Source: test13.c
**
-** Purpose: Test #13 for the sprintf function. Tests the (uppercase)
+** Purpose: Test #13 for the sprintf_s function. Tests the (uppercase)
** hexadecimal specifier (%X)
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/testinfo.dat
index 1c4c2fc26e..fd5f53017c 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test13/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test13/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test13
Description
-= Tests sscanf with floats (decimal notation)
+= Tests sprintf_s with hex numbers (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/CMakeLists.txt
index 60ac2922d7..60ac2922d7 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test14/test14.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp
index 20e986a9c3..668edda433 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test14/test14.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/test14.cpp
@@ -6,7 +6,7 @@
**
** Source: test14.c
**
-** Purpose: Test #14 for the sprintf function. Tests the lowercase
+** Purpose: Test #14 for the sprintf_s function. Tests the lowercase
** exponential notation double specifier (%e)
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/testinfo.dat
index 97db6e4ffd..23cf423354 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test14/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test14/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test14
Description
-= Tests sscanf with floats (exponential notation, lowercase)
+= Tests sprintf_s with exponential format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/CMakeLists.txt
index 57bba40e6c..57bba40e6c 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test15/test15.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp
index 34199b2eb3..61e0e362a1 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test15/test15.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/test15.cpp
@@ -6,7 +6,7 @@
**
** Source: test15.c
**
-** Purpose: Test #15 for the sprintf function. Tests the uppercase
+** Purpose: Test #15 for the sprintf_s function. Tests the uppercase
** exponential notation double specifier (%E)
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/testinfo.dat
index 30c2cf4b30..537e6d1db2 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test15/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test15/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test15
Description
-= Tests sscanf with floats (exponential notation, uppercase)
+= Tests sprintf_s with exponential format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/CMakeLists.txt
index fc93e1a67d..fc93e1a67d 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test16/test16.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp
index c93b68bc2d..b237c98d5c 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test16/test16.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/test16.cpp
@@ -6,7 +6,7 @@
**
** Source: test16.c
**
-** Purpose: Test #16 for the sprintf function. Tests the decimal notation
+** Purpose: Test #16 for the sprintf_s function. Tests the decimal notation
** double specifier (%f)
**
**
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/testinfo.dat
index e18fab1ad8..4e98eccac2 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test16/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test16/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test16
Description
-= Tests sprintf with decimal point format doubles
+= Tests sprintf_s with decimal point format doubles
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/CMakeLists.txt
index dc5ff2bb30..dc5ff2bb30 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test17/test17.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp
index 643215b8f5..220555e5d4 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test17/test17.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/test17.cpp
@@ -6,7 +6,7 @@
**
** Source: test17.c
**
-** Purpose: Test #17 for the sprintf function. Tests the lowercase
+** Purpose: Test #17 for the sprintf_s function. Tests the lowercase
** shorthand notation double specifier (%g)
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/testinfo.dat
index e23be8541e..5e41e20d44 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test17/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test17/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test17
Description
-= Tests sscanf with floats (compact notation, uppercase)
+= Tests sprintf_s with compact format doubles (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test18/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/CMakeLists.txt
index f6e1b09efa..f6e1b09efa 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test18/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test18/test18.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp
index fa88152479..2135a6f1e7 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test18/test18.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/test18.cpp
@@ -6,7 +6,7 @@
**
** Source: test18.c
**
-** Purpose: Test #18 for the sprintf function. Tests the uppercase
+** Purpose: Test #18 for the sprintf_s function. Tests the uppercase
** shorthand notation double specifier (%G)
**
**
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test18/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/testinfo.dat
index dfafa4bcf4..06ae3a632e 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test18/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test18/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test18
Description
-= Tests sprintf with compact format doubles (uppercase)
+= Tests sprintf_s with compact format doubles (uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test19/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/CMakeLists.txt
index 757288b694..757288b694 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test19/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test19/test19.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp
index bf3360c567..483c7167b1 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test19/test19.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/test19.cpp
@@ -6,7 +6,7 @@
**
** Source: test19.c
**
-** Purpose: Test #19 for the sprintf function. Tests the variable length
+** Purpose: Test #19 for the sprintf_s function. Tests the variable length
** precision argument.
**
**
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
@@ -33,13 +33,6 @@ int __cdecl main(int argc, char *argv[])
DoArgumentPrecTest("%.*s", 2, (void*)"bar", "bar", "ba", "ba");
DoArgumentPrecTest("%.*S", 2, (void*)convert("bar"), "bar", "ba", "ba");
- DoArgumentPrecTest("%.*n", 3, (void*)&n, "pointer to int", "", "");
- if (n != 0)
- {
- Fail("ERROR: Expected count parameter to resolve to %d, got %X\n",
- 0, n);
- }
-
DoArgumentPrecTest("%.*c", 0, (void*)'a', "a", "a", "a");
DoArgumentPrecTest("%.*c", 4, (void*)'a', "a", "a", "a");
DoArgumentPrecTest("%.*C", 0, (void*)'a', "a", "a", "a");
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test19/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/testinfo.dat
index ebd13025f6..7064c01771 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test19/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test19/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test19
Description
-= Tests sprintf with argument specified precision
+= Tests sprintf_s with argument specified precision
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/CMakeLists.txt
index d569263da4..d569263da4 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test2/test2.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp
index d50679a5a3..990f4f04a8 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test2/test2.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/test2.cpp
@@ -6,7 +6,7 @@
**
** Source: test2.c
**
-** Purpose: Test #2 for the sprintf function. Tests the string specifier
+** Purpose: Test #2 for the sprintf_s function. Tests the string specifier
** (%s).
**
**
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/testinfo.dat
index e8d0f53ff3..cce2dc67e7 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test2/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test2/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test2
Description
-= Tests sprintf with strings
+= Tests sprintf_s with strings
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/CMakeLists.txt
index 518c3f847a..518c3f847a 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test3/test3.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp
index ae52dbed08..c0dc8e1716 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test3/test3.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/test3.cpp
@@ -6,7 +6,7 @@
**
** Source: test3.c
**
-** Purpose: Test #3 for the sprintf function. Tests the wide string
+** Purpose: Test #3 for the sprintf_s function. Tests the wide string
** specifier (%S).
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/testinfo.dat
index c38a498225..cc8de0eae5 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test3/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test3/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test3
Description
-= Tests sscanf with bracketed set strings
+= Tests sprintf_s with wide strings
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/CMakeLists.txt
index 260def44aa..260def44aa 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test4/test4.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp
index 9660ffaa3a..46115ad5ae 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test4/test4.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/test4.cpp
@@ -6,7 +6,7 @@
**
** Source: test4.c
**
-** Purpose: Test #4 for the sprintf function. Tests the pointer
+** Purpose: Test #4 for the sprintf_s function. Tests the pointer
** specifier (%p).
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
*/
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/testinfo.dat
index bf7236dc32..f53f784991 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test4/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test4/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test4
Description
-= Tests sprintf with pointers
+= Tests sprintf_s with pointers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/CMakeLists.txt
index fce1f204fd..fce1f204fd 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test6/test6.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp
index c14e075475..c5fc804071 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test6/test6.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/test6.cpp
@@ -6,7 +6,7 @@
**
** Source: test6.c
**
-** Purpose: Test #6 for the sprintf function. Tests the char specifier (%c).
+** Purpose: Test #6 for the sprintf_s function. Tests the char specifier (%c).
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/testinfo.dat
index 037e4106ff..c5b93fc78c 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test6/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test6/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test6
Description
-= Tests sprintf with characters
+= Tests sprintf_s with characters
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/CMakeLists.txt
index 72a831ec89..72a831ec89 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test7/test7.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp
index 082bd20e6d..fd46ae9674 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test7/test7.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/test7.cpp
@@ -6,7 +6,7 @@
**
** Source: test7.c
**
-** Purpose: Test #7 for the sprintf function. Tests the wide char
+** Purpose: Test #7 for the sprintf_s function. Tests the wide char
** specifier (%C).
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/testinfo.dat
index a2730bc97c..647c9d80fd 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test7/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test7/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test7
Description
-= Tests sprintf with wide characters
+= Tests sprintf_s with wide characters
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/CMakeLists.txt
index c9522c1c9d..c9522c1c9d 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test8/test8.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp
index 9587c82c94..db02627bb0 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test8/test8.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/test8.cpp
@@ -6,7 +6,7 @@
**
** Source: test8.c
**
-** Purpose: Test #8 for the sprintf function. Tests the decimal
+** Purpose: Test #8 for the sprintf_s function. Tests the decimal
** specifier (%d).
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/testinfo.dat
index 2cbc31ad2a..524834e53e 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test8/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test8/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test8
Description
-= Tests sscanf with unsigned numbers
+= Tests sprintf_s with decimal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/CMakeLists.txt
index e76fed4784..e76fed4784 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test9/test9.cpp b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp
index 98f5db6ec1..2e1c78ce68 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test9/test9.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/test9.cpp
@@ -6,7 +6,7 @@
**
** Source: test9.c
**
-** Purpose: Test #9 for the sprintf function. Tests the integer
+** Purpose: Test #9 for the sprintf_s function. Tests the integer
** specifier (%i).
**
**
@@ -15,7 +15,7 @@
#include <palsuite.h>
-#include "../sprintf.h"
+#include "../sprintf_s.h"
/*
* Depends on memcmp and strlen
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/testinfo.dat
index e569e789cd..7c51443a3d 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test9/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sprintf_s/test9/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sprintf_s
+Name = Positive Test for sprintf_s
TYPE = DEFAULT
EXE1 = test9
Description
-= Tests sprintf with integer numbers
+= Tests sprintf_s with integer numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/CMakeLists.txt
index 59f39a5f58..59f39a5f58 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/sscanf.h b/src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h
index 397f05cead..8a99d87cb4 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/sscanf.h
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/sscanf_s.h
@@ -4,15 +4,15 @@
/*============================================================================
**
-** Source: sscanf.h
+** Source: sscanf_s.h
**
-** Purpose: Contains common testing functions for sscanf.h
+** Purpose: Contains common testing functions for sscanf_s
**
**
**==========================================================================*/
-#ifndef __SSCANF_H__
-#define __SSCANF_H__
+#ifndef __SSCANF_S_H__
+#define __SSCANF_S_H__
void DoVoidTest(char *inputstr, const char *formatstr)
{
@@ -20,10 +20,10 @@ void DoVoidTest(char *inputstr, const char *formatstr)
int i;
int ret;
- ret = sscanf(inputstr, formatstr, buf);
+ ret = sscanf_s(inputstr, formatstr, buf);
if (ret != 0)
{
- Fail("ERROR: Expected sscanf to return 0, got %d.\n"
+ Fail("ERROR: Expected sscanf_s to return 0, got %d.\n"
"Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
}
@@ -43,10 +43,10 @@ void DoStrTest(char *inputstr, const char *formatstr, const char *checkstr)
char buf[256] = { 0 };
int ret;
- ret = sscanf(inputstr, formatstr, buf);
+ ret = sscanf_s(inputstr, formatstr, buf, _countof(buf));
if (ret != 1)
{
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
"Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
}
@@ -64,10 +64,10 @@ void DoWStrTest(char *inputstr, const char *formatstr, const WCHAR *checkstr)
WCHAR buf[256] = { 0 };
int ret;
- ret = sscanf(inputstr, formatstr, buf);
+ ret = sscanf_s(inputstr, formatstr, buf, _countof(buf));
if (ret != 1)
{
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
"Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
}
@@ -85,10 +85,10 @@ void DoNumTest(char *inputstr, const char *formatstr, int checknum)
int num;
int ret;
- ret = sscanf(inputstr, formatstr, &num);
+ ret = sscanf_s(inputstr, formatstr, &num);
if (ret != 1)
{
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
"Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
}
@@ -104,10 +104,10 @@ void DoShortNumTest(char *inputstr, const char *formatstr, short checknum)
short num;
int ret;
- ret = sscanf(inputstr, formatstr, &num);
+ ret = sscanf_s(inputstr, formatstr, &num);
if (ret != 1)
{
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
"Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
}
@@ -125,17 +125,17 @@ void DoI64NumTest(char *inputstr, const char *formatstr, INT64 checknum)
INT64 num;
int ret;
- ret = sscanf(inputstr, formatstr, &num);
+ ret = sscanf_s(inputstr, formatstr, &num);
if (ret != 1)
{
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
"Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
}
if (checknum != num)
{
- sprintf(buf, "%I64d", num);
- sprintf(check, "%I64d", checknum);
+ sprintf_s(buf, _countof(buf), "%I64d", num);
+ sprintf_s(check, _countof(check), "%I64d", checknum);
Fail("ERROR: scanned I64 number incorrectly from \"%s\" using \"%s\".\n"
"Expected %s, got %s.\n", inputstr, formatstr, check, buf);
}
@@ -150,10 +150,10 @@ void DoCharTest(char *inputstr, const char *formatstr, char* checkchars, int num
for (i=0; i<256; i++)
buf[i] = (char)-1;
- ret = sscanf(inputstr, formatstr, buf);
+ ret = sscanf_s(inputstr, formatstr, buf, _countof(buf));
if (ret != 1)
{
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
"Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
}
@@ -183,10 +183,10 @@ void DoWCharTest(char *inputstr, const char *formatstr, WCHAR* checkchars, int n
for (i=0; i<256; i++)
buf[i] = (WCHAR)-1;
- ret = sscanf(inputstr, formatstr, buf);
+ ret = sscanf_s(inputstr, formatstr, buf, _countof(buf));
if (ret != 1)
{
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
"Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
}
@@ -218,12 +218,12 @@ void DoFloatTest(char *inputstr, const char *formatstr, float checkval)
for (i=0; i<256; i++)
buf[i] = (char)-1;
- ret = sscanf(inputstr, formatstr, buf);
+ ret = sscanf_s(inputstr, formatstr, buf);
val = *(float*)buf;
if (ret != 1)
{
- Fail("ERROR: Expected sscanf to return 1, got %d.\n"
+ Fail("ERROR: Expected sscanf_s to return 1, got %d.\n"
"Using \"%s\" in \"%s\".\n", ret, inputstr, formatstr);
}
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test1/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/CMakeLists.txt
index 97b8f570e3..97b8f570e3 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test1/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp
index c6f66a1d20..61313146e5 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test1/test1.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/test1.cpp
@@ -6,7 +6,7 @@
**
** Source: test1.c
**
-** Purpose: General test of sscanf
+** Purpose: General test of sscanf_s
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
@@ -38,7 +38,7 @@ int __cdecl main(int argc, char *argv[])
DoVoidTest("foo bar baz", "foo % bar %s");
DoVoidTest("foo baz bar", "foo% baz %s");
- ret = sscanf("foo bar baz", "foo bar %n", &num);
+ ret = sscanf_s("foo bar baz", "foo bar %n", &num);
if (ret != 0 || num != 8)
{
Fail("ERROR: Got incorrect values in scanning \"%s\" using \"%s\".\n"
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test1/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/testinfo.dat
index ef33ba9e13..76f592769f 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test1/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test1/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test1
Description
-= General test of sscanf
+= General test of sscanf_s
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test10/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/CMakeLists.txt
index afda216c6b..afda216c6b 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test10/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test10/test10.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp
index aac5be43ae..0c63c864ed 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test10/test10.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/test10.cpp
@@ -6,7 +6,7 @@
**
** Source: test10.c
**
-** Purpose: Tests sscanf with wide charactersn
+** Purpose: Tests sscanf_s with wide characters
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test10/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/testinfo.dat
index 7e854ed235..e048e700a0 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test10/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test10/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test10
Description
-= Tests sscanf with wide characters
+= Tests sscanf_s with wide characters
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test11/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/CMakeLists.txt
index c8f98aeeef..c8f98aeeef 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test11/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test11/test11.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp
index 0e3db6cca0..8279f4b3f4 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test11/test11.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/test11.cpp
@@ -6,7 +6,7 @@
**
** Source: test11.c
**
-** Purpose: Tests sscanf with strings
+** Purpose: Tests sscanf_s with strings
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test11/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/testinfo.dat
index 60f5cc46a4..5a906ddf51 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test11/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test11/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test11
Description
-= Tests sscanf with strings
+= Tests sscanf_s with strings
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test12/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/CMakeLists.txt
index 0ecedc3285..0ecedc3285 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test12/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test12/test12.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp
index f800e452c0..e599534270 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test12/test12.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/test12.cpp
@@ -6,7 +6,7 @@
**
** Source: test12.c
**
-** Purpose: Tests sscanf with wide strings
+** Purpose: Tests sscanf_s with wide strings
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test12/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/testinfo.dat
index 3c453bf53a..569be983c0 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test12/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test12/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test12
Description
-= Tests sscanf with wide strings
+= Tests sscanf_s with wide strings
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test13/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/CMakeLists.txt
index 4566ec3338..4566ec3338 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test13/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test13/test13.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp
index 314604e3ac..4fc12bb751 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test13/test13.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/test13.cpp
@@ -6,7 +6,7 @@
**
** Source: test13.c
**
-** Purpose: Tests sscanf with floats (decimal notation)
+** Purpose: Tests sscanf_s with floats (decimal notation)
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test13/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/testinfo.dat
index 634817a791..651577befd 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test13/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test13/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test13
Description
-= Tests sprintf with hex numbers (uppercase)
+= Tests sscanf_s with floats (decimal notation)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test14/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/CMakeLists.txt
index 557acf5bf8..557acf5bf8 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test14/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test14/test14.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp
index d1291a3b65..fc2fa2ee15 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test14/test14.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/test14.cpp
@@ -6,7 +6,7 @@
**
** Source: test14.c
**
-** Purpose: Tests sscanf with floats (exponential notation, lowercase)
+** Purpose: Tests sscanf_s with floats (exponential notation, lowercase)
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test14/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/testinfo.dat
index c7086efdbc..8e7338fd46 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test14/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test14/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test14
Description
-= Tests sprintf with exponential format doubles (lowercase)
+= Tests sscanf_s with floats (exponential notation, lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test15/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/CMakeLists.txt
index efde5c4a21..efde5c4a21 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test15/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test15/test15.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp
index fa51467d85..1eff995b86 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test15/test15.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/test15.cpp
@@ -6,7 +6,7 @@
**
** Source: test15.c
**
-** Purpose: Tests sscanf with floats (exponential notation, uppercase
+** Purpose: Tests sscanf_s with floats (exponential notation, uppercase
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test15/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/testinfo.dat
index 0a47c5321a..d713a73d81 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test15/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test15/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test15
Description
-= Tests sprintf with exponential format doubles (uppercase)
+= Tests sscanf_s with floats (exponential notation, uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test16/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/CMakeLists.txt
index 6757b0d78a..6757b0d78a 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test16/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test16/test16.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp
index 787b72ed0a..f202767448 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test16/test16.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/test16.cpp
@@ -6,7 +6,7 @@
**
** Source: test16.c
**
-** Purpose:Tests sscanf with floats (compact notation, lowercase)
+** Purpose:Tests sscanf_s with floats (compact notation, lowercase)
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test16/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/testinfo.dat
index 2c1dd42b70..669611945d 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test16/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test16/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test16
Description
-= Tests sscanf with floats (compact notation, lowercase)
+= Tests sscanf_s with floats (compact notation, lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test17/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/CMakeLists.txt
index 8ea4d5e3f6..8ea4d5e3f6 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test17/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test17/test17.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp
index c0dfd1699c..a18c3caff1 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test17/test17.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/test17.cpp
@@ -6,7 +6,7 @@
**
** Source: test17.c
**
-** Purpose: Tests sscanf with floats (compact notation, uppercase)
+** Purpose: Tests sscanf_s with floats (compact notation, uppercase)
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test17/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/testinfo.dat
index a723103e02..8ce4e93e1a 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test17/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test17/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test17
Description
-= Tests sprintf with compact format doubles (lowercase)
+= Tests sscanf_s with floats (compact notation, uppercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test2/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/CMakeLists.txt
index 4e36223a1d..4e36223a1d 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test2/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test2/test2.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp
index 1221124e3a..c9c79f67ea 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test2/test2.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/test2.cpp
@@ -6,7 +6,7 @@
**
** Source: test2.c
**
-** Purpose: Test to see if sscanf handles whitespace correctly
+** Purpose: Test to see if sscanf_s handles whitespace correctly
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
/*
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test2/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/testinfo.dat
index f5ee4b52d4..85fed244f9 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test2/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test2/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test2
Description
-= Test to see if sscanf handles whitespace correctly
+= Test to see if sscanf_s handles whitespace correctly
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test3/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/CMakeLists.txt
index 053a96ca0f..053a96ca0f 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test3/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test3/test3.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp
index 9d18991070..e1e45bdd70 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test3/test3.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/test3.cpp
@@ -6,7 +6,7 @@
**
** Source: test3.c
**
-** Purpose: Tests sscanf with bracketed set strings
+** Purpose: Tests sscanf_s with bracketed set strings
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test3/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/testinfo.dat
index 12e0a9cfb0..523d31e82e 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test3/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test3/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test3
Description
-= Tests sprintf with wide strings
+= Tests sscanf_s with bracketed set strings
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test4/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/CMakeLists.txt
index ae04bfef57..ae04bfef57 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test4/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test4/test4.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp
index dd0538bcfe..f8413ea7fd 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test4/test4.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/test4.cpp
@@ -6,7 +6,7 @@
**
** Source: test4.c
**
-** Purpose: Tests sscanf with decimal numbers
+** Purpose: Tests sscanf_s with decimal numbers
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test4/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/testinfo.dat
index 868056a6a5..2065f2bea2 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test4/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test4/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test4
Description
-= Tests sscanf with decimal numbers
+= Tests sscanf_s with decimal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test5/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/CMakeLists.txt
index 33dcaffec3..33dcaffec3 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test5/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test5/test5.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp
index 0d45248af3..cdfefd860b 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test5/test5.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/test5.cpp
@@ -6,7 +6,7 @@
**
** Source: test5.c
**
-** Purpose: Tests sscanf with integer numbers
+** Purpose: Tests sscanf_s with integer numbers
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test5/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/testinfo.dat
index 8678dc8f5a..cb687c15cd 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test5/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test5/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test5
Description
-= Tests sscanf with integer numbers
+= Tests sscanf_s with integer numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test6/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/CMakeLists.txt
index 1dd23c3cb1..1dd23c3cb1 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test6/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test6/test6.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp
index c45ea31b04..507b100e15 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test6/test6.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/test6.cpp
@@ -6,7 +6,7 @@
**
** Source: test6.c
**
-** Purpose: Tests sscanf with octal numbers
+** Purpose: Tests sscanf_s with octal numbers
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test6/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/testinfo.dat
index b2547a776a..9e518dddf2 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test6/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test6/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test6
Description
-= Tests sscanf with octal numbers
+= Tests sscanf_s with octal numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test7/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/CMakeLists.txt
index 015a27b776..015a27b776 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test7/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test7/test7.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp
index 0899671d64..4093e009e1 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test7/test7.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/test7.cpp
@@ -6,7 +6,7 @@
**
** Source: test7.c
**
-** Purpose: Tests sscanf with hex numbers (lowercase)
+** Purpose: Tests sscanf_s with hex numbers (lowercase)
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test7/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/testinfo.dat
index 614333e650..8d6c182c90 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test7/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test7/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test7
Description
-= Tests sscanf with hex numbers (lowercase)
+= Tests sscanf_s with hex numbers (lowercase)
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test8/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/CMakeLists.txt
index aa41ab42a6..aa41ab42a6 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test8/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test8/test8.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp
index 53252f8929..23ef22a56a 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test8/test8.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/test8.cpp
@@ -6,7 +6,7 @@
**
** Source: test8.c
**
-** Purpose:Tests sscanf with unsigned number
+** Purpose:Tests sscanf_s with unsigned number
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
{
diff --git a/src/pal/tests/palsuite/c_runtime/sprintf/test8/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/testinfo.dat
index adc0b66f06..0287a495d2 100644
--- a/src/pal/tests/palsuite/c_runtime/sprintf/test8/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test8/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section = C Runtime
-Function = sprintf
-Name = Positive Test for sprintf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test8
Description
-= Tests sprintf with decimal numbers
+= Tests sscanf_s with unsigned numbers
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test9/CMakeLists.txt b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/CMakeLists.txt
index b631fd40ea..b631fd40ea 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test9/CMakeLists.txt
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/CMakeLists.txt
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test9/test9.cpp b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp
index c5a2e0de5d..2c99c40e5d 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test9/test9.cpp
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/test9.cpp
@@ -6,7 +6,7 @@
**
** Source: test9.c
**
-** Purpose: Tests sscanf with characters
+** Purpose: Tests sscanf_s with characters
**
**
**==========================================================================*/
@@ -14,7 +14,7 @@
#include <palsuite.h>
-#include "../sscanf.h"
+#include "../sscanf_s.h"
int __cdecl main(int argc, char *argv[])
diff --git a/src/pal/tests/palsuite/c_runtime/sscanf/test9/testinfo.dat b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/testinfo.dat
index c0ccc8a4c9..95f6c74ee2 100644
--- a/src/pal/tests/palsuite/c_runtime/sscanf/test9/testinfo.dat
+++ b/src/pal/tests/palsuite/c_runtime/sscanf_s/test9/testinfo.dat
@@ -4,9 +4,9 @@
Version = 1.0
Section =C Runtime
-Function = sscanf
-Name = Positive Test for sscanf
+Function = sscanf_s
+Name = Positive Test for sscanf_s
TYPE = DEFAULT
EXE1 = test9
Description
-= Tests sscanf with characters
+= Tests sscanf_s with characters
diff --git a/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h b/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h
index 6e40332fa6..6349b7dcd6 100644
--- a/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h
+++ b/src/pal/tests/palsuite/c_runtime/swscanf/swscanf.h
@@ -145,8 +145,8 @@ void DoI64NumTest(WCHAR *inputstr, const WCHAR *formatstr, INT64 checknum)
if (checknum != num)
{
- sprintf(buf, "%I64d", num);
- sprintf(check, "%I64d", checknum);
+ sprintf_s(buf, _countof(buf), "%I64d", num);
+ sprintf_s(check, _countof(check), "%I64d", checknum);
Fail("ERROR: scanned I64 number incorrectly from \"%s\" using \"%s\".\n"
"Expected %s, got %s.\n", convertC(inputstr),
convertC(formatstr), check, buf);
diff --git a/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp
index 789eebf5a3..e9a79d3880 100644
--- a/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp
+++ b/src/pal/tests/palsuite/c_runtime/wcscat/test1/test1.cpp
@@ -18,7 +18,7 @@
#include <palsuite.h>
/*
- * Notes: uses memcmp and the (pal) sprintf
+ * Notes: uses memcmp and the (pal) sprintf_s
*/
int __cdecl main(int argc, char *argv[])
@@ -60,7 +60,7 @@ int __cdecl main(int argc, char *argv[])
if (memcmp(dest, test, sizeof(test)) != 0)
{
- sprintf(buffer, "%S", dest);
+ sprintf_s(buffer, _countof(buffer), "%S", dest);
Fail("ERROR: Expected wcscat to give \"%s\", got \"%s\"\n",
"foo bar baz", buffer);
}
diff --git a/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp b/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp
index 4e45c86516..2ecafa8307 100644
--- a/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp
+++ b/src/pal/tests/palsuite/c_runtime/wcscpy/test1/test1.cpp
@@ -15,7 +15,7 @@
#include <palsuite.h>
/*
- * Notes: uses memcmp and sprintf.
+ * Notes: uses memcmp and sprintf_s.
*/
int __cdecl main(int argc, char *argv[])
@@ -37,7 +37,7 @@ int __cdecl main(int argc, char *argv[])
if (ret != dest || memcmp(dest, result, sizeof(result)) != 0)
{
- sprintf(buffer, "%S", dest);
+ sprintf_s(buffer, _countof(buffer), "%S", dest);
Fail("Expected wcscpy to give \"%s\" with a return value of %p, got \"%s\" "
"with a return value of %p.\n", "foo", dest, buffer, ret);
}
diff --git a/src/pal/tests/palsuite/common/palsuite.h b/src/pal/tests/palsuite/common/palsuite.h
index 459a730806..b77ca2ead5 100644
--- a/src/pal/tests/palsuite/common/palsuite.h
+++ b/src/pal/tests/palsuite/common/palsuite.h
@@ -133,7 +133,7 @@ inline ULONG VAL32(ULONG x)
#define th_htons(w) (((w) >> 8) | ((w) << 8))
#endif // BIGENDIAN
-
+#define _countof(_array) (sizeof(_array)/sizeof(_array[0]))
WCHAR* convert(const char * aString)
{
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp
index 060945f8fe..f390c10c72 100644
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test1/test1.cpp
@@ -67,7 +67,7 @@ int __cdecl main(int argc, char *argv[])
ResetEvent(hEvFromHelper);
ResetEvent(hEvToHelper);
- if (!sprintf(cmdComposeBuf, "helper %s", commsFileName))
+ if (!sprintf_s(cmdComposeBuf, _countof(cmdComposeBuf), "helper %s", commsFileName))
{
Fail("Could not convert command line\n");
}
diff --git a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp
index e0218f3267..15b4b3f79d 100644
--- a/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp
+++ b/src/pal/tests/palsuite/debug_api/WriteProcessMemory/test3/test3.cpp
@@ -67,7 +67,7 @@ int __cdecl main(int argc, char *argv[])
"(already exists!)\n", szcFromHelperEvName);
}
- if (!sprintf(cmdComposeBuf, "helper %s", commsFileName))
+ if (!sprintf_s(cmdComposeBuf, _countof(cmdComposeBuf), "helper %s", commsFileName))
{
Fail("Could not convert command line\n");
}
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.cpp b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.cpp
index 2bb441e732..4082d38b36 100644
--- a/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.cpp
+++ b/src/pal/tests/palsuite/file_io/CreateDirectoryA/test1/CreateDirectoryA.cpp
@@ -254,7 +254,7 @@ int __cdecl main(int argc, char *argv[])
/* directories with dots */
memset(szDirName, 0, buf_size);
- sprintf(szDirName, szDotDir);
+ sprintf_s(szDirName, _countof(szDirName), szDotDir);
bRc = CreateDirectoryA(szDirName, NULL);
if (bRc == FALSE)
{
diff --git a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.cpp b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.cpp
index 9b020cc19c..bbaedda745 100644
--- a/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.cpp
+++ b/src/pal/tests/palsuite/file_io/CreateDirectoryW/test1/CreateDirectoryW.cpp
@@ -289,7 +289,7 @@ int __cdecl main(int argc, char *argv[])
/* directories with dots */
memset(szDirName, 0, 252);
- sprintf(szDirName, ".dotDirectory");
+ sprintf_s(szDirName, _countof(szDirName), ".dotDirectory");
pTemp = convert(szDirName);
bRc = CreateDirectoryW(pTemp, NULL);
if (bRc == FALSE)
diff --git a/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp b/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp
index a70867a5c8..f98fc5b9c5 100644
--- a/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp
+++ b/src/pal/tests/palsuite/file_io/CreateFileA/test1/CreateFileA.cpp
@@ -21,7 +21,7 @@ BOOL Cleanup(void)
// loop through all accesses, modes, dispositions and flags
for (i=0; i<4*8*4*5; ++i) {
- sprintf(FileName, "test%03d.txt", i);
+ sprintf_s(FileName, _countof(FileName), "test%03d.txt", i);
if (DeleteFileA(FileName) == FALSE) {
if (GetLastError() != ERROR_FILE_NOT_FOUND) {
bRet = FALSE;
@@ -98,7 +98,7 @@ int __cdecl main(int argc, char *argv[])
// creation disp loop
for (l = 0; l < 5; l++)
{
- sprintf(lpFileName, "test%03d.txt", nCounter);
+ sprintf_s(lpFileName, _countof(lpFileName), "test%03d.txt", nCounter);
hFile = CreateFile(lpFileName,
dwDesiredAccess[i],
dwShareMode[j],
diff --git a/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp b/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp
index 4d7d20af29..0619f5b4aa 100644
--- a/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp
+++ b/src/pal/tests/palsuite/file_io/CreateFileW/test1/CreateFileW.cpp
@@ -21,7 +21,7 @@ BOOL Cleanup(void)
// loop through all accesses, modes, dispositions and flags
for (i=0; i<4*8*4*5; ++i) {
- sprintf(FileName, "test%03d.txt", i);
+ sprintf_s(FileName, _countof(FileName), "test%03d.txt", i);
if (DeleteFileA(FileName) == FALSE) {
if (GetLastError() != ERROR_FILE_NOT_FOUND) {
bRet = FALSE;
@@ -99,7 +99,7 @@ int __cdecl main(int argc, char *argv[])
// creation disp loop
for (l = 0; l < 5; l++)
{
- sprintf(string, "test%03d.txt", nCounter);
+ sprintf_s(string, _countof(string), "test%03d.txt", nCounter);
lpFileName = convert(string);
hFile = CreateFileW(lpFileName,
dwDesiredAccess[i],
diff --git a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp
index 8ede8bab04..bea8e2776e 100644
--- a/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp
+++ b/src/pal/tests/palsuite/file_io/GetTempFileNameA/test1/GetTempFileNameA.cpp
@@ -104,7 +104,7 @@ int __cdecl main(int argc, char *argv[])
}
/* now verify that it only used the first 3 characters of the prefix */
- sprintf(szTempString, "%s\\%s", szDot, szLongValidPrefix);
+ sprintf_s(szTempString, _countof(szTempString), "%s\\%s", szDot, szLongValidPrefix);
if (strncmp(szTempString, szReturnedName, 6) == 0)
{
Fail("GetTempFileNameA: ERROR -> It appears that an improper prefix "
diff --git a/src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.cpp b/src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.cpp
index 8d1bc0eded..6d1337af03 100644
--- a/src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.cpp
+++ b/src/pal/tests/palsuite/file_io/MoveFileA/test1/MoveFileA.cpp
@@ -56,7 +56,7 @@ int createExisting(void)
}
memset(szBuffer, 0, 100);
- sprintf(szBuffer, "%s/test01.txt", lpSource[2]);
+ sprintf_s(szBuffer, _countof(szBuffer), "%s/test01.txt", lpSource[2]);
tempFile = fopen(szBuffer, "w");
if (tempFile != NULL)
{
@@ -70,7 +70,7 @@ int createExisting(void)
}
memset(szBuffer, 0, 100);
- sprintf(szBuffer, "%s/test02.txt", lpSource[2]);
+ sprintf_s(szBuffer, _countof(szBuffer), "%s/test02.txt", lpSource[2]);
tempFile = fopen(szBuffer, "w");
if (tempFile != NULL)
{
@@ -184,10 +184,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpSource[2]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpSource[2]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpSource[2]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpSource[2]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpSource[2]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpSource[2], 103);
}
@@ -200,10 +200,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpSource[3]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpSource[3]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpSource[3]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpSource[3]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpSource[3]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpSource[3], 103);
}
@@ -216,10 +216,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpDestination[0]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpDestination[0]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[0]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpDestination[0]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[0]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpDestination[0], 103);
}
@@ -231,10 +231,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpDestination[1]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpDestination[1]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[1]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpDestination[1]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[1]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpDestination[1], 103);
}
@@ -246,10 +246,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpDestination[2]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpDestination[2]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[2]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpDestination[2]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[2]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpDestination[2], 103);
}
@@ -261,10 +261,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpDestination[3]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpDestination[3]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[3]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpDestination[3]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[3]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpDestination[3], 103);
}
diff --git a/src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.cpp b/src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.cpp
index 58999302d0..8a7fae5983 100644
--- a/src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.cpp
+++ b/src/pal/tests/palsuite/file_io/MoveFileW/test1/MoveFileW.cpp
@@ -59,7 +59,7 @@ int createExisting(void)
}
memset(szBuffer, 0, 100);
- sprintf(szBuffer, "%s/test01.txt", lpSource[2]);
+ sprintf_s(szBuffer, _countof(szBuffer), "%s/test01.txt", lpSource[2]);
tempFile = fopen(szBuffer, "w");
if (tempFile != NULL)
{
@@ -73,7 +73,7 @@ int createExisting(void)
}
memset(szBuffer, 0, 100);
- sprintf(szBuffer, "%s/test02.txt", lpSource[2]);
+ sprintf_s(szBuffer, _countof(szBuffer), "%s/test02.txt", lpSource[2]);
tempFile = fopen(szBuffer, "w");
if (tempFile != NULL)
{
@@ -186,10 +186,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpSource[2]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpSource[2]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpSource[2]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpSource[2]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpSource[2]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpSource[2], 103);
}
@@ -202,10 +202,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpSource[3]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpSource[3]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpSource[3]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpSource[3]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpSource[3]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpSource[3], 103);
}
@@ -218,10 +218,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpDestination[0]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpDestination[0]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[0]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpDestination[0]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[0]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpDestination[0], 103);
}
@@ -233,10 +233,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpDestination[1]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpDestination[1]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[1]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpDestination[1]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[1]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpDestination[1], 103);
}
@@ -248,10 +248,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpDestination[2]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpDestination[2]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[2]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpDestination[2]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[2]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpDestination[2], 103);
}
@@ -263,10 +263,10 @@ void removeAll(void)
dwAtt = GetFileAttributesA(lpDestination[3]);
if (( dwAtt != INVALID_FILE_ATTRIBUTES ) && ( dwAtt & FILE_ATTRIBUTE_DIRECTORY) )
{
- sprintf(szTemp, "%s/test01.txt", lpDestination[3]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test01.txt", lpDestination[3]);
removeFileHelper(szTemp, 18);
- sprintf(szTemp, "%s/test02.txt", lpDestination[3]);
+ sprintf_s(szTemp, _countof(szTemp), "%s/test02.txt", lpDestination[3]);
removeFileHelper(szTemp, 19);
removeDirectoryHelper(lpDestination[3], 103);
}
diff --git a/src/pal/tests/palsuite/file_io/RemoveDirectoryA/test1/RemoveDirectoryA.cpp b/src/pal/tests/palsuite/file_io/RemoveDirectoryA/test1/RemoveDirectoryA.cpp
index 167af58163..4eb53d0d0a 100644
--- a/src/pal/tests/palsuite/file_io/RemoveDirectoryA/test1/RemoveDirectoryA.cpp
+++ b/src/pal/tests/palsuite/file_io/RemoveDirectoryA/test1/RemoveDirectoryA.cpp
@@ -48,7 +48,7 @@ int __cdecl main(int argc, char *argv[])
* remove a directory that does not exist
*/
szTemp = (char *) malloc (sizeof("test_directory"));
- sprintf(szTemp, "test_directory");
+ sprintf_s(szTemp, sizeof("test_directory"), "test_directory");
bRc = RemoveDirectoryA(szTemp);
if (bRc != FALSE)
{
@@ -69,7 +69,7 @@ int __cdecl main(int argc, char *argv[])
}
char *szSymlinkName = (char *) malloc (sizeof("test_directory_symlink"));
- sprintf(szSymlinkName, "test_directory_symlink");
+ sprintf_s(szSymlinkName, sizeof("test_directory_symlink"), "test_directory_symlink");
if (symlink(szTemp, szSymlinkName) != 0)
{
Fail("Error:RemoveDirectoryA: Failed to create a symlink to the directory \"test_directory\".\n");
@@ -140,7 +140,7 @@ int __cdecl main(int argc, char *argv[])
* directories with dots
*/
memset(szDirName, 0, 252);
- sprintf(szDirName, ".dotDirectory");
+ sprintf_s(szDirName, _countof(szDirName), ".dotDirectory");
szTemp = (char *) malloc (sizeof(szDirName));
szTemp = strncpy(szTemp, szDirName, strlen(szDirName) + 1);
@@ -170,7 +170,7 @@ int __cdecl main(int argc, char *argv[])
* Try calling RemoveDirectory with a file name
*/
memset(szDirName, 0, 252);
- sprintf(szDirName, "removedirectoryw.c");
+ sprintf_s(szDirName, _countof(szDirName), "removedirectoryw.c");
szTemp = (char *) malloc (sizeof(szDirName));
szTemp = strncpy(szTemp, szDirName, strlen(szDirName) + 1);
@@ -201,7 +201,7 @@ int __cdecl main(int argc, char *argv[])
}
/* Create non_empty_dir */
- sprintf( szDirName, "non_empty_dir");
+ sprintf_s(szDirName, _countof(szDirName), "non_empty_dir");
szTemp = (char *) malloc (sizeof(szDirName));
szTemp = strncpy(szTemp, szDirName, strlen(szDirName) + 1);
bRc = CreateDirectoryA(szTemp, NULL);
@@ -229,7 +229,7 @@ int __cdecl main(int argc, char *argv[])
}
/* Create sub_dir */
- sprintf (szDirName, "sub_dir");
+ sprintf_s(szDirName, _countof(szDirName), "sub_dir");
szTemp2 = (char *) malloc (sizeof(szDirName));
szTemp2 = strncpy(szTemp2, szDirName, strlen(szDirName) + 1);
bRc = CreateDirectoryA(szTemp2, NULL);
diff --git a/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.cpp b/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.cpp
index ae1dd0fb97..ec90528069 100644
--- a/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.cpp
+++ b/src/pal/tests/palsuite/file_io/RemoveDirectoryW/test1/RemoveDirectoryW.cpp
@@ -114,7 +114,7 @@ int __cdecl main(int argc, char *argv[])
* directories with dots
*/
memset(szDirName, 0, 252);
- sprintf(szDirName, ".dotDirectory");
+ sprintf_s(szDirName, _countof(szDirName), ".dotDirectory");
szwTemp = convert(szDirName);
bRc = CreateDirectoryW(szwTemp, NULL);
if (bRc == FALSE)
@@ -142,7 +142,7 @@ int __cdecl main(int argc, char *argv[])
* Try calling RemoveDirectory with a file name
*/
memset(szDirName, 0, 252);
- sprintf(szDirName, "removedirectoryw.c");
+ sprintf_s(szDirName, _countof(szDirName), "removedirectoryw.c");
szwTemp = convert(szDirName);
bRc = RemoveDirectoryW(szwTemp);
diff --git a/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp b/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp
index 8422683301..57afdefc7b 100644
--- a/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp
+++ b/src/pal/tests/palsuite/file_io/SearchPathA/test1/SearchPathA.cpp
@@ -90,7 +90,7 @@ int __cdecl main(int argc, char *argv[]) {
}
memset(fileloc, 0, _MAX_PATH);
- sprintf(fileloc, "%s%s", fullPath, szFileNameExistsWithExt);
+ sprintf_s(fileloc, _countof(fileloc), "%s%s", fullPath, szFileNameExistsWithExt);
RemoveAll();
diff --git a/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp b/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp
index 1c8adba5ac..6880a864cb 100644
--- a/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp
+++ b/src/pal/tests/palsuite/file_io/SearchPathW/test1/SearchPathW.cpp
@@ -133,7 +133,7 @@ int __cdecl main(int argc, char *argv[]) {
}
memset(fileloc, 0, _MAX_PATH);
- sprintf(fileloc, "%s%s", fullPath, szFileNameExistsWithExt);
+ sprintf_s(fileloc, _countof(fileloc), "%s%s", fullPath, szFileNameExistsWithExt);
RemoveAll();
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.cpp b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.cpp
index c07a62412b..f227aa3268 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.cpp
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test1/SetCurrentDirectoryA.cpp
@@ -118,9 +118,9 @@ int __cdecl main(int argc, char *argv[])
/* append the temp name to the "home" directory */
memset(szBuiltDir, 0, (_MAX_DIR+1));
#if WIN32
- sprintf(szBuiltDir,"%s%s\\", szHomeDir, szDirName);
+ sprintf_s(szBuiltDir, _countof(szBuiltDir),"%s%s\\", szHomeDir, szDirName);
#else
- sprintf(szBuiltDir,"%s%s/", szHomeDir, szDirName);
+ sprintf_s(szBuiltDir, _countof(szBuiltDir),"%s%s/", szHomeDir, szDirName);
#endif
/* get the new current directory */
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.cpp b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.cpp
index 415dbbf045..4b1c1c8790 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.cpp
+++ b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryA/test2/setcurrentdirectorya.cpp
@@ -62,9 +62,9 @@ int __cdecl main(int argc, char *argv[])
/* append the temp name to the "home" directory */
memset(szBuiltDir, 0, (_MAX_DIR+1));
#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
diff --git a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp b/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp
index 7e3d7b785f..7f833baabc 100644
--- a/src/pal/tests/palsuite/file_io/SetCurrentDirectoryW/test2/setcurrentdirectoryw.cpp
+++ 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/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp
index 11ff967dfd..5cc6d77709 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp
+++ b/src/pal/tests/palsuite/filemapping_memmgt/CreateFileMappingW/test2/CreateFileMappingW.cpp
@@ -34,9 +34,9 @@ int __cdecl main(int argc, char *argv[])
}
#if WIN32
- sprintf(executableFileName,"%s","executable.exe");
+ sprintf_s(executableFileName, _countof(executableFileName),"%s","executable.exe");
#else
- sprintf(executableFileName,"%s","executable");
+ sprintf_s(executableFileName, _countof(executableFileName),"%s","executable");
#endif
//conver string to a unicode one
diff --git a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/test2.cpp b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/test2.cpp
index 91172be9e1..3aea80e1f1 100644
--- a/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/test2.cpp
+++ b/src/pal/tests/palsuite/filemapping_memmgt/ReadProcessMemory/test2/test2.cpp
@@ -73,7 +73,7 @@ int __cdecl main(int argc, char *argv[])
ResetEvent(hEvFromHelper);
ResetEvent(hEvToHelper);
- if (!sprintf(cmdComposeBuf, "helper %s", commsFileName))
+ if (!sprintf_s(cmdComposeBuf, _countof(cmdComposeBuf), "helper %s", commsFileName))
{
Fail("Could not convert command line\n");
}
@@ -138,7 +138,7 @@ int __cdecl main(int argc, char *argv[])
errno, GetLastError());
}
PEDANTIC1(fclose,(commsFile));
- sscanf(incomingCMDBuffer, LLFORMAT " " LLFORMAT, &pDestMemory, &Count);
+ sscanf_s(incomingCMDBuffer, LLFORMAT " " LLFORMAT, &pDestMemory, &Count);
if (argc > 1)
{
Trace("Preparing to write to " LLFORMAT " bytes @ " LLFORMAT "('%s')\n",
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp b/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp
index d1e6b6d1dc..ab38d1a632 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp
+++ b/src/pal/tests/palsuite/loader/LoadLibraryA/test5/loadlibrarya.cpp
@@ -31,10 +31,10 @@ int __cdecl main(int argc, char *argv[])
/*Module name without extension but with a trailing dot*/
#if WIN32
- sprintf(ModuleName, "%s", "rotor_pal.");
+ sprintf_s(ModuleName, _countof(ModuleName), "%s", "rotor_pal.");
#else
/* Under FreeBSD */
- sprintf(ModuleName, "%s", "librotor_pal.");
+ sprintf_s(ModuleName, _countof(ModuleName), "%s", "librotor_pal.");
#endif
/* load a module which does not have the file extension,
diff --git a/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp b/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp
index acaa200a06..6d92f029e4 100644
--- a/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp
+++ b/src/pal/tests/palsuite/loader/LoadLibraryW/test5/loadlibraryw.cpp
@@ -33,9 +33,9 @@ int __cdecl main(int argc, char *argv[])
/*Module name without extension but with a trailing dot*/
#if WIN32
- sprintf(ModuleName,"%s","rotor_pal.");
+ sprintf_s(ModuleName, _countof(ModuleName),"%s","rotor_pal.");
#else
- sprintf(ModuleName,"%s","librotor_pal.");
+ sprintf_s(ModuleName, _countof(ModuleName),"%s","librotor_pal.");
#endif
/* convert a normal string to a wide one */
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp
index ff0d33879c..8eb8776107 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp
+++ b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test1/PAL_RegisterLibraryW_UnregisterLibraryW.cpp
@@ -33,7 +33,7 @@ int __cdecl main(int argc, char *argv[])
/*zero the buffer*/
memset(ModuleName,0,64);
- sprintf(ModuleName, "%s", "rotor_pal");
+ sprintf_s(ModuleName, _countof(ModuleName), "%s", "rotor_pal");
/*convert a normal string to a wide one*/
wpModuleName = convert(ModuleName);
diff --git a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp
index a15ff5745b..c6fa4ad074 100644
--- a/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp
+++ b/src/pal/tests/palsuite/pal_specific/PAL_RegisterLibraryW_UnregisterLibraryW/test2_neg/reg_unreg_libraryw_neg.cpp
@@ -30,7 +30,7 @@ int __cdecl main(int argc, char *argv[])
}
memset(ModuleName, 0, 64);
- sprintf(ModuleName, "%s", "not_exist_module_name");
+ sprintf_s(ModuleName, _countof(ModuleName), "%s", "not_exist_module_name");
/*convert a normal string to a wide one*/
wpModuleName = convert(ModuleName);
diff --git a/src/pal/tests/palsuite/paltestlist.txt b/src/pal/tests/palsuite/paltestlist.txt
index d9af111b25..a5e241d397 100644
--- a/src/pal/tests/palsuite/paltestlist.txt
+++ b/src/pal/tests/palsuite/paltestlist.txt
@@ -143,44 +143,43 @@ c_runtime/sin/test1/paltest_sin_test1
c_runtime/sinf/test1/paltest_sinf_test1
c_runtime/sinh/test1/paltest_sinh_test1
c_runtime/sinhf/test1/paltest_sinhf_test1
-c_runtime/sprintf/test1/paltest_sprintf_test1
-c_runtime/sprintf/test10/paltest_sprintf_test10
-c_runtime/sprintf/test11/paltest_sprintf_test11
-c_runtime/sprintf/test12/paltest_sprintf_test12
-c_runtime/sprintf/test13/paltest_sprintf_test13
-c_runtime/sprintf/test14/paltest_sprintf_test14
-c_runtime/sprintf/test15/paltest_sprintf_test15
-c_runtime/sprintf/test16/paltest_sprintf_test16
-c_runtime/sprintf/test17/paltest_sprintf_test17
-c_runtime/sprintf/test18/paltest_sprintf_test18
-c_runtime/sprintf/test19/paltest_sprintf_test19
-c_runtime/sprintf/test2/paltest_sprintf_test2
-c_runtime/sprintf/test3/paltest_sprintf_test3
-c_runtime/sprintf/test4/paltest_sprintf_test4
-c_runtime/sprintf/test5/paltest_sprintf_test5
-c_runtime/sprintf/test6/paltest_sprintf_test6
-c_runtime/sprintf/test7/paltest_sprintf_test7
-c_runtime/sprintf/test8/paltest_sprintf_test8
-c_runtime/sprintf/test9/paltest_sprintf_test9
+c_runtime/sprintf_s/test1/paltest_sprintf_test1
+c_runtime/sprintf_s/test10/paltest_sprintf_test10
+c_runtime/sprintf_s/test11/paltest_sprintf_test11
+c_runtime/sprintf_s/test12/paltest_sprintf_test12
+c_runtime/sprintf_s/test13/paltest_sprintf_test13
+c_runtime/sprintf_s/test14/paltest_sprintf_test14
+c_runtime/sprintf_s/test15/paltest_sprintf_test15
+c_runtime/sprintf_s/test16/paltest_sprintf_test16
+c_runtime/sprintf_s/test17/paltest_sprintf_test17
+c_runtime/sprintf_s/test18/paltest_sprintf_test18
+c_runtime/sprintf_s/test19/paltest_sprintf_test19
+c_runtime/sprintf_s/test2/paltest_sprintf_test2
+c_runtime/sprintf_s/test3/paltest_sprintf_test3
+c_runtime/sprintf_s/test4/paltest_sprintf_test4
+c_runtime/sprintf_s/test6/paltest_sprintf_test6
+c_runtime/sprintf_s/test7/paltest_sprintf_test7
+c_runtime/sprintf_s/test8/paltest_sprintf_test8
+c_runtime/sprintf_s/test9/paltest_sprintf_test9
c_runtime/sqrt/test1/paltest_sqrt_test1
c_runtime/sqrtf/test1/paltest_sqrtf_test1
-c_runtime/sscanf/test1/paltest_sscanf_test1
-c_runtime/sscanf/test10/paltest_sscanf_test10
-c_runtime/sscanf/test11/paltest_sscanf_test11
-c_runtime/sscanf/test12/paltest_sscanf_test12
-c_runtime/sscanf/test13/paltest_sscanf_test13
-c_runtime/sscanf/test14/paltest_sscanf_test14
-c_runtime/sscanf/test15/paltest_sscanf_test15
-c_runtime/sscanf/test16/paltest_sscanf_test16
-c_runtime/sscanf/test17/paltest_sscanf_test17
-c_runtime/sscanf/test2/paltest_sscanf_test2
-c_runtime/sscanf/test3/paltest_sscanf_test3
-c_runtime/sscanf/test4/paltest_sscanf_test4
-c_runtime/sscanf/test5/paltest_sscanf_test5
-c_runtime/sscanf/test6/paltest_sscanf_test6
-c_runtime/sscanf/test7/paltest_sscanf_test7
-c_runtime/sscanf/test8/paltest_sscanf_test8
-c_runtime/sscanf/test9/paltest_sscanf_test9
+c_runtime/sscanf_s/test1/paltest_sscanf_test1
+c_runtime/sscanf_s/test10/paltest_sscanf_test10
+c_runtime/sscanf_s/test11/paltest_sscanf_test11
+c_runtime/sscanf_s/test12/paltest_sscanf_test12
+c_runtime/sscanf_s/test13/paltest_sscanf_test13
+c_runtime/sscanf_s/test14/paltest_sscanf_test14
+c_runtime/sscanf_s/test15/paltest_sscanf_test15
+c_runtime/sscanf_s/test16/paltest_sscanf_test16
+c_runtime/sscanf_s/test17/paltest_sscanf_test17
+c_runtime/sscanf_s/test2/paltest_sscanf_test2
+c_runtime/sscanf_s/test3/paltest_sscanf_test3
+c_runtime/sscanf_s/test4/paltest_sscanf_test4
+c_runtime/sscanf_s/test5/paltest_sscanf_test5
+c_runtime/sscanf_s/test6/paltest_sscanf_test6
+c_runtime/sscanf_s/test7/paltest_sscanf_test7
+c_runtime/sscanf_s/test8/paltest_sscanf_test8
+c_runtime/sscanf_s/test9/paltest_sscanf_test9
c_runtime/strcat/test1/paltest_strcat_test1
c_runtime/strchr/test1/paltest_strchr_test1
c_runtime/strcmp/test1/paltest_strcmp_test1
diff --git a/src/pal/tests/palsuite/palverify.dat b/src/pal/tests/palsuite/palverify.dat
index e7bfd60aed..d6e113b670 100644
--- a/src/pal/tests/palsuite/palverify.dat
+++ b/src/pal/tests/palsuite/palverify.dat
@@ -271,44 +271,43 @@ c_runtime/sin/test1,1
c_runtime/sinf/test1,1
c_runtime/sinh/test1,1
c_runtime/sinhf/test1,1
-c_runtime/sprintf/test1,1
-c_runtime/sprintf/test2,1
-c_runtime/sprintf/test3,1
-c_runtime/sprintf/test4,1
-c_runtime/sprintf/test5,1
-c_runtime/sprintf/test6,1
-c_runtime/sprintf/test7,1
-c_runtime/sprintf/test8,1
-c_runtime/sprintf/test9,1
-c_runtime/sprintf/test10,1
-c_runtime/sprintf/test11,1
-c_runtime/sprintf/test12,1
-c_runtime/sprintf/test13,1
-c_runtime/sprintf/test14,1
-c_runtime/sprintf/test15,1
-c_runtime/sprintf/test16,1
-c_runtime/sprintf/test17,1
-c_runtime/sprintf/test18,1
-c_runtime/sprintf/test19,1
+c_runtime/sprintf_s/test1,1
+c_runtime/sprintf_s/test2,1
+c_runtime/sprintf_s/test3,1
+c_runtime/sprintf_s/test4,1
+c_runtime/sprintf_s/test6,1
+c_runtime/sprintf_s/test7,1
+c_runtime/sprintf_s/test8,1
+c_runtime/sprintf_s/test9,1
+c_runtime/sprintf_s/test10,1
+c_runtime/sprintf_s/test11,1
+c_runtime/sprintf_s/test12,1
+c_runtime/sprintf_s/test13,1
+c_runtime/sprintf_s/test14,1
+c_runtime/sprintf_s/test15,1
+c_runtime/sprintf_s/test16,1
+c_runtime/sprintf_s/test17,1
+c_runtime/sprintf_s/test18,1
+c_runtime/sprintf_s/test19,1
c_runtime/sqrt/test1,1
c_runtime/sqrtf/test1,1
-c_runtime/sscanf/test1,1
-c_runtime/sscanf/test2,1
-c_runtime/sscanf/test3,1
-c_runtime/sscanf/test4,1
-c_runtime/sscanf/test5,1
-c_runtime/sscanf/test6,1
-c_runtime/sscanf/test7,1
-c_runtime/sscanf/test8,1
-c_runtime/sscanf/test9,1
-c_runtime/sscanf/test10,1
-c_runtime/sscanf/test11,1
-c_runtime/sscanf/test12,1
-c_runtime/sscanf/test13,1
-c_runtime/sscanf/test14,1
-c_runtime/sscanf/test15,1
-c_runtime/sscanf/test16,1
-c_runtime/sscanf/test17,1
+c_runtime/sscanf_s/test1,1
+c_runtime/sscanf_s/test2,1
+c_runtime/sscanf_s/test3,1
+c_runtime/sscanf_s/test4,1
+c_runtime/sscanf_s/test5,1
+c_runtime/sscanf_s/test6,1
+c_runtime/sscanf_s/test7,1
+c_runtime/sscanf_s/test8,1
+c_runtime/sscanf_s/test9,1
+c_runtime/sscanf_s/test10,1
+c_runtime/sscanf_s/test11,1
+c_runtime/sscanf_s/test12,1
+c_runtime/sscanf_s/test13,1
+c_runtime/sscanf_s/test14,1
+c_runtime/sscanf_s/test15,1
+c_runtime/sscanf_s/test16,1
+c_runtime/sscanf_s/test17,1
c_runtime/strcat/test1,1
c_runtime/strchr/test1,1
c_runtime/strcmp/test1,1