Fix warning.

This commit is contained in:
Nuno Cruces 2021-01-05 15:21:18 +00:00
parent 3770f9924a
commit c73af92d4e

View file

@ -285,8 +285,10 @@ func pickFolders(opts options, multi bool) (str string, lst []string, err error)
}
defer coTaskMemFree.Call(ptr)
res := reflect.SliceHeader{Data: ptr, Len: 32768, Cap: 32768}
str = syscall.UTF16ToString(*(*[]uint16)(unsafe.Pointer(&res)))
var res []uint16
hdr := (*reflect.SliceHeader)(unsafe.Pointer(&res))
hdr.Data, hdr.Len, hdr.Cap = ptr, 32768, 32768
str = syscall.UTF16ToString(res)
lst = append(lst, str)
return nil
}