diff options
author | Mikael Magnusson <mikma@users.sourceforge.net> | 2020-11-16 22:12:56 +0100 |
---|---|---|
committer | Mikael Magnusson <mikma@users.sourceforge.net> | 2021-06-10 22:07:59 +0200 |
commit | 97f631c3b7a868eb01ffc6c90f5a58ef1f444d30 (patch) | |
tree | 84f1aa74bb57b32bfba8f050d43d4c6c06e25c7b | |
parent | d4f0514aef7dcf857fa653643b714b9203cd2bf9 (diff) |
fix memcpy size
-rw-r--r-- | src/sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -388,13 +388,13 @@ int getsock_ip (int fd, char *ipaddr) int getmapped_ipv4 (const char *ipv6mapped_conf, const char *ipaddr, char *ipaddr_mapped) { struct in6_addr addr6; - struct in_addr addr; + struct in_addr addr; memset(&addr6, 0, sizeof(addr6)); if ( inet_pton(AF_INET6, ipaddr, &addr6) < 0 ) return -1; - memcpy(&addr, addr6.s6_addr + 12, sizeof(&addr)); + memcpy(&addr, addr6.s6_addr + 12, sizeof(addr)); return inet_ntop(AF_INET, &addr, ipaddr_mapped, IP_LENGTH) == NULL ? -1 : 0; } |