diff --git a/src/internal/syscall/windows/syscall_windows.go b/src/internal/syscall/windows/syscall_windows.go index 39ff25fcb7..8ace2a27e7 100644 --- a/src/internal/syscall/windows/syscall_windows.go +++ b/src/internal/syscall/windows/syscall_windows.go @@ -25,7 +25,7 @@ func UTF16PtrToString(p *uint16) string { n++ } // Turn *uint16 into []uint16. - s := unsafe.Slice((*uint16)(unsafe.Pointer(p)), n) + s := unsafe.Slice(p, n) // Decode []uint16 into string. return string(utf16.Decode(s)) }