aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMaxim <[email protected]>2020-04-07 13:02:48 +0200
committerMaxim <[email protected]>2020-04-07 13:02:48 +0200
commit67cee4803a3338f0ee2e049ceac215925b9cd908 (patch)
tree80767470cc5502bfc680cbcf86ce6990ff2c8e17
parent007b7d2a3f81505f615eda40f6795b95a2208bee (diff)
downloadenet-67cee4803a3338f0ee2e049ceac215925b9cd908.tar.gz
enet-67cee4803a3338f0ee2e049ceac215925b9cd908.zip
Set DWORD sentLength = 0;
Same case like receive, we should initialize this variable.
-rw-r--r--unix.c2
-rw-r--r--win32.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/unix.c b/unix.c
index acb05c3..a636f03 100644
--- a/unix.c
+++ b/unix.c
@@ -475,7 +475,7 @@ enet_socket_receive (ENetSocket socket,
{
struct msghdr msgHdr;
struct sockaddr_in sin;
- int recvLength = 0;
+ int recvLength;
memset (& msgHdr, 0, sizeof (struct msghdr));
diff --git a/win32.c b/win32.c
index 687aa9f..eebdb03 100644
--- a/win32.c
+++ b/win32.c
@@ -316,7 +316,7 @@ enet_socket_send (ENetSocket socket,
size_t bufferCount)
{
struct sockaddr_in sin;
- DWORD sentLength;
+ DWORD sentLength = 0;
if (address != NULL)
{