summaryrefslogtreecommitdiff
path: root/games/wormz/patches/patch-ae
blob: d6a6c05ff0fbbc462243d68c2b7547572f731c32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$NetBSD: patch-ae,v 1.3 2004/02/18 23:09:03 kristerw Exp $

--- Network/UDPConnection.cc.orig	Tue Jul  7 23:02:47 1998
+++ Network/UDPConnection.cc	Wed Feb 18 23:05:15 2004
@@ -66,7 +66,7 @@
   }
    
   DEBUGP("Connecting to server" << hostname << ", port " << peer_port);
-  int addr_len = sizeof(addr);
+  socklen_t addr_len = sizeof(addr);
   if (getsockname (socket_fd, (sockaddr *) &a, &addr_len)) {
     close(socket_fd);
     StdError("can't get sockname");
@@ -116,7 +116,7 @@
     StdError("can't bind socket");
     return FALSE;
   }
-  int addr_len = sizeof(addr);
+  socklen_t addr_len = sizeof(addr);
   if (getsockname (socket_fd, (sockaddr *) &addr, &addr_len)) {
     close(socket_fd);
     StdError("can't get sockname");
@@ -148,7 +148,7 @@
   return TRUE;
 }
 
-int UDPConnection::Receive(char * buffer, int maxsize, bool Wait=TRUE)
+int UDPConnection::Receive(char * buffer, int maxsize, bool Wait)
 {
   fd_set set;
   timeval timeout;
@@ -166,9 +166,9 @@
     return 0;
 
   // some data!
-  int addr_len = sizeof(addr);
+  socklen_t addr_len = sizeof(addr);
   sockaddr_in in_addr;
-  bzero(&in_addr, addr_len);
+  bzero(&in_addr, (int)addr_len);
   int ret = recvfrom (socket_fd, buffer, maxsize, 0, (sockaddr *) &in_addr, &addr_len);
   if (ret <= 0) {
     StdError("can't receive message");