From: lx-s Date: Tue, 23 Aug 2022 10:57:14 +0000 (+0200) Subject: Use W-Version of SetWorkingDirectory X-Git-Tag: 2.1.2.0~5 X-Git-Url: https://repos.lx-s.de/gitweb/?a=commitdiff_plain;h=0bb39a386cd1a9b09f73d76a2603b3951fe52253;p=winmute.git Use W-Version of SetWorkingDirectory --- diff --git a/WinMute/WinMain.cpp b/WinMute/WinMain.cpp index c930e60..02c86b8 100644 --- a/WinMute/WinMain.cpp +++ b/WinMute/WinMain.cpp @@ -37,12 +37,12 @@ HINSTANCE hglobInstance; static bool SetWorkingDirectory() { - char wmFileName[MAX_PATH + 1]; - if (GetModuleFileNameA(NULL, wmFileName, ARRAY_SIZE(wmFileName)) > 0) { - char* p = strrchr(wmFileName, '\\'); + wchar_t wmFileName[MAX_PATH + 1]; + if (GetModuleFileNameW(NULL, wmFileName, ARRAY_SIZE(wmFileName)) > 0) { + wchar_t* p = wcsrchr(wmFileName, L'\\'); if (p != NULL) { - *(p+1) = '\0'; - SetCurrentDirectoryA(wmFileName); + *(p + 1) = L'\0'; + SetCurrentDirectoryW(wmFileName); return true; } }