aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os/env.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-13 05:48:08 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-08-15 00:28:41 +0200
commit07cc72ad5d40882d3330677a8cd3fe61c5611b47 (patch)
tree76b7afaceffa946fcf72450a80b89896318935ac /src/nvim/os/env.c
parent8727f7a6a4ef10ce7536fbc003ef13b768f1aa91 (diff)
downloadrneovim-07cc72ad5d40882d3330677a8cd3fe61c5611b47.tar.gz
rneovim-07cc72ad5d40882d3330677a8cd3fe61c5611b47.tar.bz2
rneovim-07cc72ad5d40882d3330677a8cd3fe61c5611b47.zip
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
Diffstat (limited to 'src/nvim/os/env.c')
-rw-r--r--src/nvim/os/env.c4
1 files changed, 2 insertions, 2 deletions
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;