From b6136f9f8fc1ece262731de7cfce896bbef40192 Mon Sep 17 00:00:00 2001 From: yuyi Date: Fri, 1 Jan 2021 17:07:58 +0800 Subject: [PATCH] clipboard: fix `to_wide()` in clipboard_windows.c.v (#7768) --- vlib/clipboard/clipboard_windows.c.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/clipboard/clipboard_windows.c.v b/vlib/clipboard/clipboard_windows.c.v index 9c4560762e..f0880a298c 100644 --- a/vlib/clipboard/clipboard_windows.c.v +++ b/vlib/clipboard/clipboard_windows.c.v @@ -125,7 +125,7 @@ fn (mut cb Clipboard) free() { } // the string.to_wide doesn't work with SetClipboardData, don't know why -fn to_wide(text string) &C.HGLOBAL { +fn to_wide(text string) C.HGLOBAL { len_required := C.MultiByteToWideChar(C.CP_UTF8, C.MB_ERR_INVALID_CHARS, text.str, text.len + 1, C.NULL, 0) buf := C.GlobalAlloc(C.GMEM_MOVEABLE, i64(sizeof(u16)) * len_required)