From 230372df09053a95f1137da4c7b309f8610229c6 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Mon, 15 Feb 2021 20:09:02 +0200 Subject: [PATCH] clipboard: fix unsafe warning on windows (affects v-ui) --- vlib/clipboard/clipboard_windows.c.v | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vlib/clipboard/clipboard_windows.c.v b/vlib/clipboard/clipboard_windows.c.v index b147024ab2..6e06e00df5 100644 --- a/vlib/clipboard/clipboard_windows.c.v +++ b/vlib/clipboard/clipboard_windows.c.v @@ -4,6 +4,7 @@ import time #include #flag -lUser32 + struct WndClassEx { cb_size u32 style u32 @@ -173,7 +174,7 @@ fn (mut cb Clipboard) get_text() string { C.CloseClipboard() return '' } - str := string_from_wide(&u16(C.GlobalLock(h_data))) + str := unsafe { string_from_wide(&u16(C.GlobalLock(h_data))) } C.GlobalUnlock(h_data) return str }