Skip to content

Commit c0f85ca

Browse files
committed
session client BUGFIX invalid cast
Fixes #413
1 parent 0b15664 commit c0f85ca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/session_client.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,9 +1532,9 @@ nc_saddr2str(const struct sockaddr *saddr, char **str_ip)
15321532
}
15331533

15341534
if (saddr->sa_family == AF_INET) {
1535-
addr = &((struct sockaddr_in *)&saddr)->sin_addr;
1535+
addr = &((struct sockaddr_in *)saddr)->sin_addr;
15361536
} else {
1537-
addr = &((struct sockaddr_in6 *)&saddr)->sin6_addr;
1537+
addr = &((struct sockaddr_in6 *)saddr)->sin6_addr;
15381538
}
15391539
if (!inet_ntop(saddr->sa_family, addr, *str_ip, str_len)) {
15401540
ERR(NULL, "Converting host to IP address failed (%s).", strerror(errno));

0 commit comments

Comments
 (0)