mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
clipboard: wrap pointer indexing in unsafe block (#6178)
This commit is contained in:
parent
d8d707b4fe
commit
6eea13ecc2
@ -133,7 +133,9 @@ fn to_wide(text string) &C.HGLOBAL {
|
||||
if buf != C.HGLOBAL(C.NULL) {
|
||||
mut locked := &u16(C.GlobalLock(buf))
|
||||
C.MultiByteToWideChar(C.CP_UTF8, C.MB_ERR_INVALID_CHARS, text.str, text.len + 1, locked, len_required)
|
||||
locked[len_required - 1] = u16(0)
|
||||
unsafe {
|
||||
locked[len_required - 1] = u16(0)
|
||||
}
|
||||
C.GlobalUnlock(buf)
|
||||
}
|
||||
return buf
|
||||
|
Loading…
Reference in New Issue
Block a user