summaryrefslogtreecommitdiffhomepage
path: root/tun
diff options
context:
space:
mode:
Diffstat (limited to 'tun')
-rw-r--r--tun/wintun/registry/registry_windows.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/tun/wintun/registry/registry_windows.go b/tun/wintun/registry/registry_windows.go
index 6be88fd..70419a5 100644
--- a/tun/wintun/registry/registry_windows.go
+++ b/tun/wintun/registry/registry_windows.go
@@ -183,7 +183,7 @@ func toString(buf []byte, valueType uint32, err error) (string, error) {
if len(buf) == 0 {
return "", nil
}
- value = windows.UTF16ToString((*[(1 << 30) - 1]uint16)(unsafe.Pointer(&buf[0]))[:len(buf)/2])
+ value = windows.UTF16PtrToString((*uint16)(unsafe.Pointer(&buf[0])))
default:
return "", registry.ErrUnexpectedType