From: Ian Jackson Date: Sat, 21 Sep 2019 10:05:21 +0000 (+0100) Subject: udp.c: Add a comment about the salen cast X-Git-Tag: v0.4.5~3 X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/commitdiff_plain/4e54b3ca5259017e5b1eea6257253ff914cef073 udp.c: Add a comment about the salen cast Signed-off-by: Ian Jackson --- diff --git a/udp.c b/udp.c index ee38d51..0d945ac 100644 --- a/udp.c +++ b/udp.c @@ -269,7 +269,8 @@ static bool_t record_socket_gotaddr(struct udpcommon *uc, struct udpsock *us, socklen_t salen=sizeof(us->addr); int r=getsockname(us->fd,&us->addr.sa,&salen); if (r) FAIL("getsockname()"); - if ((size_t)salen>sizeof(us->addr)) { errno=0; FAIL("getsockname() length"); } + if ((size_t)salen>sizeof(us->addr)) /* cast squashes clang warning */ + { errno=0; FAIL("getsockname() length"); } return True; failed: