mirror of https://github.com/mkerrisk/man-pages
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 <colomar.6.4.3@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
8e4dfb59d7
commit
facc3c56fe
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue