Linux-man Archive on lore.kernel.org
 help / color / Atom feed
* 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, back to index

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)

Linux-man Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-man/0 linux-man/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-man linux-man/ https://lore.kernel.org/linux-man \
		linux-man@vger.kernel.org
	public-inbox-index linux-man

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-man


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git