* small issue in getifaddrs(3) man page
@ 2020-02-28 15:33 Michael Galassi
2020-03-02 7:00 ` Michael Kerrisk (man-pages)
0 siblings, 1 reply; 2+ messages in thread
From: Michael Galassi @ 2020-02-28 15:33 UTC (permalink / raw)
To: mtk.manpages; +Cc: linux-man
Hi,
The getifaddrs(3) man page has some sample code which includes a for
loop wich initializes and increments an in named "n" which is never
used. This is slightly confusing (but in no way wrong). The page
would be clearer if this variable declaration, initialization, and
increment were removed.
The two lines in question are:
int family, s, n;
...
for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa->ifa_next, n++) {
Thanks.
-michael
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: small issue in getifaddrs(3) man page
2020-02-28 15:33 small issue in getifaddrs(3) man page Michael Galassi
@ 2020-03-02 7:00 ` Michael Kerrisk (man-pages)
0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-03-02 7:00 UTC (permalink / raw)
To: Michael Galassi; +Cc: linux-man
Hello Michael,
On Fri, 28 Feb 2020 at 16:34, Michael Galassi <michael@galassi.us> wrote:
>
> Hi,
>
> The getifaddrs(3) man page has some sample code which includes a for
> loop wich initializes and increments an in named "n" which is never
> used. This is slightly confusing (but in no way wrong). The page
> would be clearer if this variable declaration, initialization, and
> increment were removed.
Agreed. (And mea culpa.) I've made the change as you suggest. Thanks
for the report!
Cheers,
Michael
>
> The two lines in question are:
> int family, s, n;
> ...
> for (ifa = ifaddr, n = 0; ifa != NULL; ifa = ifa->ifa_next, n++) {
>
> Thanks.
>
> -michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-02 7:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 15:33 small issue in getifaddrs(3) man page Michael Galassi
2020-03-02 7:00 ` Michael Kerrisk (man-pages)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).