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:
parent
341744781a
commit
8b96032139
@ -612,7 +612,7 @@ static int create_socket()
|
||||
|
||||
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_port = htons(port);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user