]> Creatis software - crea.git/commitdiff
#3204 crea Feature New Normal branch mingw64
authorEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 25 Jul 2018 11:38:22 +0000 (13:38 +0200)
committerEduardo DAVILA <davila@creatis.insa-lyon.fr>
Wed, 25 Jul 2018 11:38:22 +0000 (13:38 +0200)
src/creaSystem.cxx

index 5640b070a0c981ca7cdfd17d8ce2f3acc68146dc..a05556b0ce86b8c0da7b750e1414615295176c08 100644 (file)
@@ -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;