]> repos.lx-s.de Git - winmute.git/commitdiff
Use W-Version of SetWorkingDirectory
authorlx-s <lx-s@users.noreply.github.com>
Tue, 23 Aug 2022 10:57:14 +0000 (12:57 +0200)
committerlx-s <lx-s@users.noreply.github.com>
Tue, 23 Aug 2022 10:57:14 +0000 (12:57 +0200)
WinMute/WinMain.cpp

index c930e60858a705fb67cb833c5f2e66f401555522..02c86b81b77da374e0912a1509b3bae2bbed4357 100644 (file)
@@ -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;
       }
    }