patch to initialize sockaddr by Jarda Benkovsky

This commit is contained in:
gfk
2001-10-19 22:26:58 +00:00
parent 85957e2154
commit 8b19e5bc12
+2
View File
@@ -1,6 +1,7 @@
#include <unistd.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/socket.h>
@@ -30,6 +31,7 @@ sock_init_sockaddr (sockaddr_in * name, const char *hostname, unsigned short int
{
struct hostent *hostinfo;
memset (name, 0, sizeof (*name));
name->sin_family = AF_INET;
name->sin_port = htons (port);
hostinfo = gethostbyname (hostname);