#25 wcstombs could not process Directory success

open
nobody
None
5
2012-09-14
2011-11-15
Anonymous
No

Win32GUI.c
Line 281
wcstombs(fileName, wfileName, MAXPATHLEN);
need to be changed to :
MultiByteToWideChar(CP_ACP, 0, fileName, strlen(fileName), wfileName, MAXPATHLEN );

Console.c
Line 84 to be changed to:
#ifdef MS_WINDOWS
MultiByteToWideChar(CP_ACP, 0, fileName, strlen(fileName), wfileName, MAXPATHLEN );
#else
wcstombs(fileName, wfileName, MAXPATHLEN);
#endif

Discussion

  • Anthony
    Anthony
    2011-11-16

    This change could fix the issue when user try to put compiled exe file into folder with name other than english,such as Chinese name folder. MultiByteToWideChar is safer in windows system.

     


Anonymous


Cancel   Add attachments