Module: wine Branch: master Commit: fc6b9399db0d9f9a8ab1bfa9baf737381cc5284f URL: https://gitlab.winehq.org/wine/wine/-/commit/fc6b9399db0d9f9a8ab1bfa9baf7373...
Author: Alexandre Julliard julliard@winehq.org Date: Wed Sep 20 13:49:27 2023 +0200
kernel32/tests: Don't make assumptions about argv[0] of the main process.
---
dlls/kernel32/tests/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index c298b9ab0fa..8bb2748f8e1 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -237,7 +237,7 @@ static BOOL init(void)
myARGC = winetest_get_mainargs( &myARGV ); if (!GetCurrentDirectoryA(sizeof(base), base)) return FALSE; - strcpy(selfname, myARGV[0]); + GetModuleFileNameA( 0, selfname, sizeof(selfname) );
/* Strip the path of selfname */ if ((p = strrchr(selfname, '\')) != NULL) exename = p + 1;