utf16_to_utf8: align with libuv

- take a size parameter
- return libuv error code
- handle error in caller only (avoid redundant messages)

53995a3825
4c945f4936
This commit is contained in:
Justin M. Keyes
2019-08-13 05:48:08 +02:00
parent 8727f7a6a4
commit 07cc72ad5d
5 changed files with 49 additions and 42 deletions

View File

@@ -1208,7 +1208,7 @@ char *os_resolve_shortcut(const char *fname)
ZeroMemory(wsz, MAX_PATH * sizeof(wchar_t));
hr = pslw->lpVtbl->GetPath(pslw, wsz, MAX_PATH, &ffdw, 0);
if (hr == S_OK && wsz[0] != NUL) {
const int conversion_result = utf16_to_utf8(wsz, &rfname);
const int conversion_result = utf16_to_utf8(wsz, -1, &rfname);
if (conversion_result != 0) {
EMSG2("utf16_to_utf8 failed: %d", conversion_result);
}