Skip to content

Commit 45fbc34

Browse files
zsxOldes
authored andcommitted
Initialize sa.sin_zero
(cherry picked from commit d8d625f)
1 parent e86d9bc commit 45fbc34

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/os/dev-net.c

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ extern HWND Event_Handle; // For WSAAsync API
7171
static void Set_Addr(SOCKAI *sa, long ip, int port)
7272
{
7373
// Set the IP address and port number in a socket_addr struct.
74+
memset(sa, 0, sizeof(*sa));
7475
sa->sin_family = AF_INET;
7576
sa->sin_addr.s_addr = ip; //htonl(ip); NOTE: REBOL stays in network byte order
7677
sa->sin_port = htons((unsigned short)port);

0 commit comments

Comments
 (0)