clipboard: fix unsafe warning on windows (affects v-ui)
parent
c057b45bb1
commit
230372df09
|
@ -4,6 +4,7 @@ import time
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#flag -lUser32
|
#flag -lUser32
|
||||||
|
|
||||||
struct WndClassEx {
|
struct WndClassEx {
|
||||||
cb_size u32
|
cb_size u32
|
||||||
style u32
|
style u32
|
||||||
|
@ -173,7 +174,7 @@ fn (mut cb Clipboard) get_text() string {
|
||||||
C.CloseClipboard()
|
C.CloseClipboard()
|
||||||
return ''
|
return ''
|
||||||
}
|
}
|
||||||
str := string_from_wide(&u16(C.GlobalLock(h_data)))
|
str := unsafe { string_from_wide(&u16(C.GlobalLock(h_data))) }
|
||||||
C.GlobalUnlock(h_data)
|
C.GlobalUnlock(h_data)
|
||||||
return str
|
return str
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue