From: Piotr Caban piotr@codeweavers.com
--- dlls/msvcrt/file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index bb1b0792ebe..66ff2f5dcba 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -2606,14 +2606,13 @@ int WINAPIV _wsopen( const wchar_t *path, int oflags, int shflags, ... ) int CDECL _sopen_dispatch( const char *path, int oflags, int shflags, int pmode, int *fd, int secure) { - wchar_t *pathW; + wchar_t *pathW = NULL; int ret;
if (!MSVCRT_CHECK_PMT(fd != NULL)) return EINVAL; *fd = -1; - if(!MSVCRT_CHECK_PMT(path && (pathW = msvcrt_wstrdupa(path)))) - return EINVAL; + if (path && !(pathW = wstrdupa_utf8(path))) return *_errno();
ret = _wsopen_dispatch(pathW, oflags, shflags, pmode, fd, secure); free(pathW);