From 6c9c4fe9918a41d8d907c2b409d3a08992f6f543 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sat, 10 Aug 2019 14:28:44 -0400 Subject: [PATCH] win: use L'\0' as UTF-16 null terminator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Saúl Ibarra Corretgé --- src/win/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win/util.c b/src/win/util.c index 359a16aed..d548c86c8 100644 --- a/src/win/util.c +++ b/src/win/util.c @@ -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; }