[PATCH 1/3] advapi32/tests: Change sprintf to PathCombineA to avoid GCC warnings
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> --- dlls/advapi32/tests/Makefile.in | 2 +- dlls/advapi32/tests/service.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/advapi32/tests/Makefile.in b/dlls/advapi32/tests/Makefile.in index 12583e59f5..83c9c1d91c 100644 --- a/dlls/advapi32/tests/Makefile.in +++ b/dlls/advapi32/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = advapi32.dll -IMPORTS = ole32 advapi32 +IMPORTS = ole32 advapi32 shlwapi C_SRCS = \ cred.c \ diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c index 9dad710490..0059b4ae40 100644 --- a/dlls/advapi32/tests/service.c +++ b/dlls/advapi32/tests/service.c @@ -29,6 +29,7 @@ #include "winnls.h" #include "lmcons.h" #include "aclapi.h" +#include "shlwapi.h" #include "wine/test.h" @@ -212,9 +213,9 @@ static void test_create_delete_svc(void) GetUserNameA(username, &user_size); /* Get the domainname to cater for that situation */ if (GetEnvironmentVariableA("USERDOMAIN", domain, MAX_PATH)) - sprintf(account, "%s\\%s", domain, username); + PathCombineA(account, domain, username); else - sprintf(account, ".\\%s", username); + PathCombineA(account, ".", username); /* All NULL */ SetLastError(0xdeadbeef); -- 2.23.0
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> --- dlls/advpack/tests/Makefile.in | 2 +- dlls/advpack/tests/files.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/advpack/tests/Makefile.in b/dlls/advpack/tests/Makefile.in index 9c1fecebe9..1c0d0a248e 100644 --- a/dlls/advpack/tests/Makefile.in +++ b/dlls/advpack/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = advpack.dll -IMPORTS = cabinet advapi32 advpack +IMPORTS = cabinet advapi32 advpack shlwapi C_SRCS = \ advpack.c \ diff --git a/dlls/advpack/tests/files.c b/dlls/advpack/tests/files.c index 1851dc16f0..d96645aa72 100644 --- a/dlls/advpack/tests/files.c +++ b/dlls/advpack/tests/files.c @@ -22,6 +22,7 @@ #include <windows.h> #include <advpub.h> #include <fci.h> +#include <shlwapi.h> #include "wine/test.h" /* make the max size large so there is only one cab file */ @@ -162,7 +163,7 @@ static void test_AddDelBackupEntry(void) RemoveDirectoryA("backup"); GetWindowsDirectoryA(windir, sizeof(windir)); - sprintf(path, "%s\\basename.INI", windir); + PathCombineA(path, windir, "basename.INI"); /* try a NULL backup dir, INI is created in the windows directory */ res = pAddDelBackupEntry("one\0two\0three\0", NULL, "basename", AADBE_ADD_ENTRY); -- 2.23.0
Signed-off-by: Alex Henrie <alexhenrie24(a)gmail.com> --- dlls/fusion/tests/Makefile.in | 2 +- dlls/fusion/tests/asmenum.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dlls/fusion/tests/Makefile.in b/dlls/fusion/tests/Makefile.in index 02a6ae3970..04ddee8919 100644 --- a/dlls/fusion/tests/Makefile.in +++ b/dlls/fusion/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = fusion.dll -IMPORTS = user32 +IMPORTS = user32 shlwapi C_SRCS = \ asmcache.c \ diff --git a/dlls/fusion/tests/asmenum.c b/dlls/fusion/tests/asmenum.c index 115089e674..fa9fb7c618 100644 --- a/dlls/fusion/tests/asmenum.c +++ b/dlls/fusion/tests/asmenum.c @@ -402,10 +402,10 @@ static void test_enumerate_name(void) to_multibyte(gac, buf); create_full_path(gac); - sprintf(path, "%s\\Wine", gac); + PathCombineA(path, gac, "Wine"); CreateDirectoryA(path, NULL); - sprintf(path, "%s\\Wine\\1.0.0.0__16a3fcd171e93a8d", gac); + PathCombineA(path, gac, "Wine\\1.0.0.0__16a3fcd171e93a8d"); CreateDirectoryA(path, NULL); lstrcatA(path, "\\Wine.dll"); @@ -415,7 +415,7 @@ static void test_enumerate_name(void) goto done; } - sprintf(path, "%s\\Wine\\1.0.1.2__16a3fcd171e93a8d", gac); + PathCombineA(path, gac, "Wine\\1.0.1.2__16a3fcd171e93a8d"); CreateDirectoryA(path, NULL); lstrcatA(path, "\\Wine.dll"); @@ -425,7 +425,7 @@ static void test_enumerate_name(void) goto done; } - sprintf(path, "%s\\Wine\\1.0.1.2__123456789abcdef0", gac); + PathCombineA(path, gac, "Wine\\1.0.1.2__123456789abcdef0"); CreateDirectoryA(path, NULL); lstrcatA(path, "\\Wine.dll"); @@ -663,19 +663,19 @@ static void test_enumerate_name(void) IAssemblyName_Release(asmname); done: - sprintf(path, "%s\\Wine\\1.0.0.0__16a3fcd171e93a8d\\Wine.dll", gac); + PathCombineA(path, gac, "Wine\\1.0.0.0__16a3fcd171e93a8d\\Wine.dll"); DeleteFileA(path); - sprintf(path, "%s\\Wine\\1.0.1.2__16a3fcd171e93a8d\\Wine.dll", gac); + PathCombineA(path, gac, "Wine\\1.0.1.2__16a3fcd171e93a8d\\Wine.dll"); DeleteFileA(path); - sprintf(path, "%s\\Wine\\1.0.1.2__123456789abcdef0\\Wine.dll", gac); + PathCombineA(path, gac, "Wine\\1.0.1.2__123456789abcdef0\\Wine.dll"); DeleteFileA(path); - sprintf(path, "%s\\Wine\\1.0.0.0__16a3fcd171e93a8d", gac); + PathCombineA(path, gac, "Wine\\1.0.0.0__16a3fcd171e93a8d"); RemoveDirectoryA(path); - sprintf(path, "%s\\Wine\\1.0.1.2__16a3fcd171e93a8d", gac); + PathCombineA(path, gac, "Wine\\1.0.1.2__16a3fcd171e93a8d"); RemoveDirectoryA(path); - sprintf(path, "%s\\Wine\\1.0.1.2__123456789abcdef0", gac); + PathCombineA(path, gac, "Wine\\1.0.1.2__123456789abcdef0"); RemoveDirectoryA(path); - sprintf(path, "%s\\Wine", gac); + PathCombineA(path, gac, "Wine"); RemoveDirectoryA(path); } -- 2.23.0
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=56329 Your paranoid android. === w864 (32 bit report) === advapi32: service.c:1813: Test failed: Failed to create service, error 1072. service.c:1816: Test failed: Got error 6. service.c:1819: Test failed: Failed to delete service, error 6.
participants (2)
-
Alex Henrie -
Marvin