diff options
author | defanor <defanor@uberspace.net> | 2023-04-15 19:00:16 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2023-04-15 19:00:16 +0300 |
commit | ecc91dd9f2fe31b28e4a9027502eaf07c757594d (patch) | |
tree | 6b565ea4948547a129d345b41435ab9146ddf443 | |
parent | f043ec91b21eb04335f84c31a3cb117c20f69e17 (diff) |
Fix an inet_pton argument
-rw-r--r-- | src/rexmpp_tcp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rexmpp_tcp.c b/src/rexmpp_tcp.c index 3022182..77509b2 100644 --- a/src/rexmpp_tcp.c +++ b/src/rexmpp_tcp.c @@ -123,7 +123,7 @@ rexmpp_tcp_conn_init (rexmpp_t *s, struct sockaddr_in addr_v4; int flags; - if (inet_pton(AF_INET, host, &addr_v4)) { + if (inet_pton(AF_INET, host, &(addr_v4.sin_addr))) { addr_v4.sin_family = AF_INET; addr_v4.sin_port = htons(port); conn->sockets[conn->connection_attempts] = @@ -144,7 +144,7 @@ rexmpp_tcp_conn_init (rexmpp_t *s, return REXMPP_CONN_IN_PROGRESS; } struct sockaddr_in6 addr_v6; - if (inet_pton(AF_INET6, host, &addr_v6)) { + if (inet_pton(AF_INET6, host, &(addr_v6.sin6_addr))) { addr_v6.sin6_family = AF_INET6; addr_v6.sin6_port = htons(port); addr_v6.sin6_flowinfo = 0; |