From facc3c56fe52eb54a5f1eb037268926d9327f770 Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Thu, 3 Sep 2020 21:46:35 +0200 Subject: [PATCH] getaddrinfo.3: Use sizeof consistently Use ``sizeof`` consistently through all the examples in the following way: - Use the name of the variable instead of its type as argument for ``sizeof``. Rationale: https://www.kernel.org/doc/html/v5.8/process/coding-style.html#allocating-memory Signed-off-by: Alejandro Colomar Signed-off-by: Michael Kerrisk --- man3/getaddrinfo.3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man3/getaddrinfo.3 b/man3/getaddrinfo.3 index 158fd2e31..70e6b4cc0 100644 --- a/man3/getaddrinfo.3 +++ b/man3/getaddrinfo.3 @@ -721,7 +721,7 @@ main(int argc, char *argv[]) /* Read datagrams and echo them back to sender */ for (;;) { - peer_addr_len = sizeof(struct sockaddr_storage); + peer_addr_len = sizeof(peer_addr); nread = recvfrom(sfd, buf, BUF_SIZE, 0, (struct sockaddr *) &peer_addr, &peer_addr_len); if (nread == \-1)