Fix a bug pointed out by Rob Landley <rlandley@austin.rr.com>, where

setup_sockaddr_in was zeroing the sizeof a pointer, not the sizeof the struct,
which was obviously what was intended.  Thanks Rob,
 -Erik
This commit is contained in:
Eric Andersen 2001-03-17 05:43:39 +00:00
parent 341744781a
commit 8b96032139
2 changed files with 2 additions and 2 deletions

View File

@ -612,7 +612,7 @@ static int create_socket()
static void setup_sockaddr_in(struct sockaddr_in * addr, int port) static void setup_sockaddr_in(struct sockaddr_in * addr, int port)
{ {
memset(addr, 0, sizeof addr); memset(addr, 0, sizeof(struct sockaddr_in));
addr->sin_family = AF_INET; addr->sin_family = AF_INET;
addr->sin_port = htons(port); addr->sin_port = htons(port);
} }

View File

@ -612,7 +612,7 @@ static int create_socket()
static void setup_sockaddr_in(struct sockaddr_in * addr, int port) static void setup_sockaddr_in(struct sockaddr_in * addr, int port)
{ {
memset(addr, 0, sizeof addr); memset(addr, 0, sizeof(struct sockaddr_in));
addr->sin_family = AF_INET; addr->sin_family = AF_INET;
addr->sin_port = htons(port); addr->sin_port = htons(port);
} }