wmbiff: correct the address size passed to connect(2).
`addr` is a `struct sockaddr_in`, not a `struct sockaddr`; using `sizeof var` instead of `sizeof (type)` ensures that the right size is used. Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
This commit is contained in:
parent
3c0016eb79
commit
1d9d06f152
|
@ -64,7 +64,7 @@ static int ipv4_sock_connect(struct in_addr *address, uint16_t port)
|
|||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = *(u_long *) address;
|
||||
addr.sin_port = htons(port);
|
||||
i = connect(fd, (struct sockaddr *) &addr, sizeof(struct sockaddr));
|
||||
i = connect(fd, (struct sockaddr *) &addr, sizeof addr);
|
||||
if (i == -1) {
|
||||
int saved_errno = errno;
|
||||
perror("Error connecting");
|
||||
|
|
Loading…
Reference in a new issue