Skip to content

Commit c10701f

Browse files
tklausergopherbot
authored andcommitted
windows: use unsafe.Slice in (*RawSockaddrAny).Sockaddr on windows
Same as CL 472035 did in package syscall. Change-Id: I153dfaa19933a2707848e4183d6ca704c2800a0e Reviewed-on: https://go-review.googlesource.com/c/sys/+/472016 Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> Auto-Submit: Tobias Klauser <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 6f25076 commit c10701f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

windows/syscall_windows.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -1022,8 +1022,7 @@ func (rsa *RawSockaddrAny) Sockaddr() (Sockaddr, error) {
10221022
for n < len(pp.Path) && pp.Path[n] != 0 {
10231023
n++
10241024
}
1025-
bytes := (*[len(pp.Path)]byte)(unsafe.Pointer(&pp.Path[0]))[0:n]
1026-
sa.Name = string(bytes)
1025+
sa.Name = string(unsafe.Slice((*byte)(unsafe.Pointer(&pp.Path[0])), n))
10271026
return sa, nil
10281027

10291028
case AF_INET:

0 commit comments

Comments
 (0)