From: YeshunYe yeyeshun@uniontech.com
'mbstowcs_s' will make a wrong path in non-ASCII environments.
Signed-off-by: YeshunYe yeyeshun@uniontech.com --- dlls/msvcp60/ios.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/msvcp60/ios.c b/dlls/msvcp60/ios.c index 1fef80f8a43..59779b4df8d 100644 --- a/dlls/msvcp60/ios.c +++ b/dlls/msvcp60/ios.c @@ -26,6 +26,7 @@ #include "msvcp.h" #include "windef.h" #include "winbase.h" +#include "winnls.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(msvcp);
@@ -2125,10 +2126,13 @@ static FILE* _Fiopen_wchar(const wchar_t *name, int mode, int prot) FILE* __cdecl ___Fiopen(const char *name, int mode) { wchar_t nameW[FILENAME_MAX]; + int result;
TRACE("(%p %d)\n", name, mode); + result = MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, FILENAME_MAX-1); + nameW[result] = 0;
- if(mbstowcs_s(NULL, nameW, FILENAME_MAX, name, FILENAME_MAX-1) != 0) + if(result == 0) return NULL; return _Fiopen_wchar(nameW, mode, _SH_DENYNO); }