Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> --- In my opinion, when using CP_UNIXCP, the caller shouldn't care whether it fell back to UTF-8 or not, and it should not fail if the last two parameters are non-NULL. This should simplify caller code that uses CP_UNIXCP with a non-NULL 'used' parameter. dlls/kernel32/locale.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 2698b3d..1770319 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -2729,6 +2729,9 @@ INT WINAPI WideCharToMultiByte( UINT page, DWORD flags, LPCWSTR src, INT srclen, if (used) *used = used_tmp; break; } + if (used) *used = FALSE; + defchar = NULL; + used = NULL; /* fall through */ case CP_UTF8: if (defchar || used) -- 2.21.0