From 8d127430d057891fbd3ac5989d32090715d7923a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 16 Feb 2018 22:07:43 +0200 Subject: fixes #1143 (CmdLine Plugin error when using Diacritics in message) --- plugins/CmdLine/src/services.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/CmdLine/src/services.cpp') diff --git a/plugins/CmdLine/src/services.cpp b/plugins/CmdLine/src/services.cpp index 56c768878a..66f1c6d310 100644 --- a/plugins/CmdLine/src/services.cpp +++ b/plugins/CmdLine/src/services.cpp @@ -75,11 +75,11 @@ int StartServer() HANDLE server = mir_forkthread(ServerWorkerThread, nullptr); if (server) { - char path[MIMFOLDER_SIZE]; - GetModuleFileNameA(GetModuleHandle(nullptr), path, sizeof(path)); - char *p = strrchr(path, '\\'); - if (p) { *p = 0; } - strncpy_s(sdCmdLine->mimFolder, path, _TRUNCATE); + wchar_t path[MIMFOLDER_SIZE]; + GetModuleFileNameW(GetModuleHandle(nullptr), path, _countof(path)); + wchar_t *p = wcsrchr(path, '\\'); + if (p) *p = 0; + wcsncpy_s(sdCmdLine->mimFolder, path, _TRUNCATE); sdCmdLine->instances++; failure = 0; @@ -96,4 +96,4 @@ extern "C" __declspec(dllexport) void ListCommands(PCommand * commands, int *cou { *commands = mimCommands; *count = cMimCommands; -} \ No newline at end of file +} -- cgit v1.2.3