initialize socklen

This commit is contained in:
David du Colombier 2014-08-03 18:19:36 +02:00
parent ef218ac4d8
commit cf7e56655b

1
net.c
View File

@ -59,6 +59,7 @@ netannounce(int istcp, char *server, int port)
} }
/* set reuse flag for tcp */ /* set reuse flag for tcp */
sn = sizeof n;
if(istcp && getsockopt(fd, SOL_SOCKET, SO_TYPE, (void*)&n, &sn) >= 0){ if(istcp && getsockopt(fd, SOL_SOCKET, SO_TYPE, (void*)&n, &sn) >= 0){
n = 1; n = 1;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&n, sizeof n); setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char*)&n, sizeof n);