Browse Source

Set DWORD sentLength = 0;

Same case like receive, we should initialize this variable.
Maxim 5 years ago
parent
commit
67cee4803a
2 changed files with 2 additions and 2 deletions
  1. 1 1
      unix.c
  2. 1 1
      win32.c

+ 1 - 1
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));
 

+ 1 - 1
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)
     {