diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-04 10:44:42 -0600 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-09-04 11:08:29 -0600 |
commit | 4ed60c09ee40f22f99afd59f3ff94866b7aa0cc4 (patch) | |
tree | df5d7df445df552374ea62771c9ec2e3c6c511aa /src/socket.c | |
parent | 93b6e83e4faa8de6247e0e46d5060ec543befef8 (diff) |
global: prefer sizeof(*pointer) when possible
Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/socket.c')
-rw-r--r-- | src/socket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/socket.c b/src/socket.c index f544dd0..2e9e44f 100644 --- a/src/socket.c +++ b/src/socket.c @@ -245,7 +245,7 @@ int socket_send_buffer_as_reply_to_skb(struct wireguard_device *wg, int socket_endpoint_from_skb(struct endpoint *endpoint, const struct sk_buff *skb) { - memset(endpoint, 0, sizeof(struct endpoint)); + memset(endpoint, 0, sizeof(*endpoint)); if (skb->protocol == htons(ETH_P_IP)) { endpoint->addr4.sin_family = AF_INET; endpoint->addr4.sin_port = udp_hdr(skb)->source; |