Browse Source

Make recvLength = 0; In the rare case of it having bogus data.

I noticed from testing this that this might be the source of it, I once had a package returned with length total bogus. like 982349829 or something like that, it crashed my game, I suspect this is the source.
Maxim 5 năm trước cách đây
mục cha
commit
92bf2d8256
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      win32.c

+ 1 - 1
win32.c

@@ -354,7 +354,7 @@ enet_socket_receive (ENetSocket socket,
 {
     INT sinLength = sizeof (struct sockaddr_in);
     DWORD flags = 0,
-          recvLength;
+          recvLength = 0;
     struct sockaddr_in sin;
 
     if (WSARecvFrom (socket,