From: Eduardo DAVILA Date: Wed, 25 Jul 2018 11:38:22 +0000 (+0200) Subject: #3204 crea Feature New Normal branch mingw64 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=ad0282622fc7ae88e2c844842a415968f1de10fe;hp=39d91a8ecbd442c26197528c21e7e762f3ae7026;p=crea.git #3204 crea Feature New Normal branch mingw64 --- diff --git a/src/creaSystem.cxx b/src/creaSystem.cxx index 5640b07..a05556b 100644 --- a/src/creaSystem.cxx +++ b/src/creaSystem.cxx @@ -100,8 +100,8 @@ int System::GetAppPath(char *pname, size_t pathsize) //2018-07-06 mingw64 wchar_t pname2[512]; - mbstowcs(pname2,pname,strlen(pname)+1); long result = GetModuleFileName(NULL, pname2, pathsize); + int ret = wcstombs ( pname, pname2, sizeof(pname) ); // long result = GetModuleFileName(NULL, pname, pathsize); if (result > 0) @@ -219,8 +219,8 @@ std::string System::GetDllAppPath(std::string &nomdll){ //2018-07-06 mingw64 wchar_t currentPath2[512]; - mbstowcs(currentPath2,currentPath,strlen(currentPath)+1); GetModuleFileName(hand, currentPath2, _MAX_PATH); + int ret = wcstombs ( currentPath, currentPath2, sizeof(pname) ); // GetModuleFileName(hand, currentPath, _MAX_PATH); path = currentPath; @@ -244,8 +244,8 @@ std::string System::GetDllAppPath(const char *nomdll){ //2018-07-06 mingw64 wchar_t currentPath2[512]; - mbstowcs(currentPath2,currentPath,strlen(currentPath)+1); GetModuleFileName(hand, currentPath2, _MAX_PATH); + int ret = wcstombs ( currentPath, currentPath2, sizeof(pname) ); // GetModuleFileName(hand, currentPath, _MAX_PATH); path = currentPath;