diff --git a/sdk/lib/crt/string/wcs.c b/sdk/lib/crt/string/wcs.c index e056bf593f6..f238a78616d 100644 --- a/sdk/lib/crt/string/wcs.c +++ b/sdk/lib/crt/string/wcs.c @@ -246,6 +246,9 @@ INT CDECL wctomb( char *dst, wchar_t ch ) BOOL error; INT size; + if (!dst) + return 0; + size = WideCharToMultiByte(get_locinfo()->lc_codepage, 0, &ch, 1, dst, dst ? 6 : 0, NULL, &error); if(!size || error) { *_errno() = EINVAL;