1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

clipboard: fix unsafe warning on windows (affects v-ui)

This commit is contained in:
Delyan Angelov 2021-02-15 20:09:02 +02:00
parent c057b45bb1
commit 230372df09
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED

View File

@ -4,6 +4,7 @@ import time
#include <windows.h>
#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
}