summaryrefslogtreecommitdiff
path: root/lib/socket.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2011-10-27 12:13:03 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2011-10-27 12:13:03 +0200
commit408e980a83437ed621fa99ae0cd8d2bc6579f5ba (patch)
tree7f73587d84487f989bca966a22fc1c85c3f8397b /lib/socket.cc
parent7d8e6af2df12442c1c133956b3acf3fdbc496423 (diff)
Fix warnings and error (due to bitrot)master-old
Diffstat (limited to 'lib/socket.cc')
-rw-r--r--lib/socket.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/socket.cc b/lib/socket.cc
index 37e985a..db0cb41 100644
--- a/lib/socket.cc
+++ b/lib/socket.cc
@@ -36,6 +36,8 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <string.h>
+
Socket::Socket(int port, std::string addr)
{
this->prt = port;
@@ -105,7 +107,7 @@ int Socket::connect()
// }
struct sockaddr_in socketaddr;
- memset((char *) &socketaddr, sizeof(socketaddr), 0);
+ memset((char *) &socketaddr, 0, sizeof(socketaddr));
socketaddr.sin_family = AF_INET;
socketaddr.sin_port = htons(prt);
socketaddr.sin_addr.s_addr = inet_addr(ip);