gnrc_sock_ip: fix memcpy()/memset() sizeof-type

The type in the `sizeof()` is just plain wrong. This fixes it.
This commit is contained in:
Martine Lenders 2016-11-08 18:15:49 +01:00 committed by Martine Lenders
parent 0c22fffcd1
commit 653e36277c

View File

@ -36,14 +36,14 @@ int sock_ip_create(sock_ip_t *sock, const sock_ip_ep_t *local,
(local->netif != remote->netif)) { (local->netif != remote->netif)) {
return -EINVAL; return -EINVAL;
} }
memset(&sock->local, 0, sizeof(sock_ip_t)); memset(&sock->local, 0, sizeof(sock_ip_ep_t));
if (local != NULL) { if (local != NULL) {
if (gnrc_af_not_supported(local->family)) { if (gnrc_af_not_supported(local->family)) {
return -EAFNOSUPPORT; return -EAFNOSUPPORT;
} }
memcpy(&sock->local, local, sizeof(sock_ip_t)); memcpy(&sock->local, local, sizeof(sock_ip_ep_t));
} }
memset(&sock->remote, 0, sizeof(sock_ip_t)); memset(&sock->remote, 0, sizeof(sock_ip_ep_t));
if (remote != NULL) { if (remote != NULL) {
if (gnrc_af_not_supported(remote->family)) { if (gnrc_af_not_supported(remote->family)) {
return -EAFNOSUPPORT; return -EAFNOSUPPORT;
@ -51,7 +51,7 @@ int sock_ip_create(sock_ip_t *sock, const sock_ip_ep_t *local,
if (gnrc_ep_addr_any(remote)) { if (gnrc_ep_addr_any(remote)) {
return -EINVAL; return -EINVAL;
} }
memcpy(&sock->remote, remote, sizeof(sock_ip_t)); memcpy(&sock->remote, remote, sizeof(sock_ip_ep_t));
} }
gnrc_sock_create(&sock->reg, GNRC_NETTYPE_IPV6, gnrc_sock_create(&sock->reg, GNRC_NETTYPE_IPV6,
proto); proto);