win: use L'\0' as UTF-16 null terminator

uv__convert_utf8_to_utf16() always null terminates its
UTF-16 output. This commit updates the code to use L'\0'
as the terminator, instead of '\0'.

Fixes: https://github.com/libuv/libuv/issues/2413
PR-URL: https://github.com/libuv/libuv/pull/2419
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
cjihrig 2019-08-10 14:28:44 -04:00
parent b0fd17193e
commit 6c9c4fe991
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -1325,7 +1325,7 @@ int uv__convert_utf8_to_utf16(const char* utf8, int utf8len, WCHAR** utf16) {
return uv_translate_sys_error(GetLastError());
}
(*utf16)[bufsize] = '\0';
(*utf16)[bufsize] = L'\0';
return 0;
}