From 07cc72ad5d40882d3330677a8cd3fe61c5611b47 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 13 Aug 2019 05:48:08 +0200 Subject: utf16_to_utf8: align with libuv - take a size parameter - return libuv error code - handle error in caller only (avoid redundant messages) https://github.com/libuv/libuv/commit/53995a3825d23eacd01e2bcfa35642c4a188d32b https://github.com/libuv/libuv/commit/4c945f49365ab4d6e1b07bf0ef2893455dc04622 --- src/nvim/os/env.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/os/env.c') diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 62457e155c..669475fa72 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -178,7 +178,7 @@ char *os_getenvname_at_index(size_t index) for (wchar_t *it = env; *it != L'\0' || *(it + 1) != L'\0'; it++) { if (index == current_index) { char *utf8_str; - int conversion_result = utf16_to_utf8(it, &utf8_str); + int conversion_result = utf16_to_utf8(it, -1, &utf8_str); if (conversion_result != 0) { EMSG2("utf16_to_utf8 failed: %d", conversion_result); break; @@ -258,7 +258,7 @@ void os_get_hostname(char *hostname, size_t size) host_utf16[host_wsize] = '\0'; char *host_utf8; - int conversion_result = utf16_to_utf8(host_utf16, &host_utf8); + int conversion_result = utf16_to_utf8(host_utf16, -1, &host_utf8); if (conversion_result != 0) { EMSG2("utf16_to_utf8 failed: %d", conversion_result); return; -- cgit