浏览代码

Set DWORD sentLength = 0;

Same case like receive, we should initialize this variable.
Maxim 5 年之前
父节点
当前提交
67cee4803a
共有 2 个文件被更改,包括 2 次插入2 次删除
  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)
     {