summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoreihrul <eihrul>2008-02-24 14:19:47 +0000
committereihrul <eihrul>2008-02-24 14:19:47 +0000
commit3856e3fd15bdc845dce441b52aabbe4c69f8d0cc (patch)
treea7cfe92128a925b0be1be334b56b1e191dd54a07
parent356ff9bc7fa933a7ab7d483756ec308c0eac49ec (diff)
downloadenet-3856e3fd15bdc845dce441b52aabbe4c69f8d0cc.tar.gz
enet-3856e3fd15bdc845dce441b52aabbe4c69f8d0cc.zip
zero out sin_zero
-rw-r--r--unix.c2
-rw-r--r--win32.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/unix.c b/unix.c
index e279bfe..132ca1a 100644
--- a/unix.c
+++ b/unix.c
@@ -274,6 +274,8 @@ enet_socket_send (ENetSocket socket,
if (address != NULL)
{
+ memset (& sin, 0, sizeof (struct sockaddr_in));
+
sin.sin_family = AF_INET;
sin.sin_port = ENET_HOST_TO_NET_16 (address -> port);
sin.sin_addr.s_addr = address -> host;
diff --git a/win32.c b/win32.c
index 27e7877..b8b2aa7 100644
--- a/win32.c
+++ b/win32.c
@@ -225,6 +225,8 @@ enet_socket_send (ENetSocket socket,
if (address != NULL)
{
+ memset (& sin, 0, sizeof (struct sockaddr_in));
+
sin.sin_family = AF_INET;
sin.sin_port = ENET_HOST_TO_NET_16 (address -> port);
sin.sin_addr.s_addr = address -> host;