linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Galassi <michael@galassi.us>
To: mtk.manpages@gmail.com
Cc: linux-man@vger.kernel.org
Subject: small issue in getifaddrs(3) man page
Date: Fri, 28 Feb 2020 07:33:54 -0800	[thread overview]
Message-ID: <CADFiD2+vbh-rhbj3G8z5F46R6cP1BSOVfpFiJju=EM00Q15-Ug@mail.gmail.com> (raw)

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

             reply	other threads:[~2020-02-28 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-28 15:33 Michael Galassi [this message]
2020-03-02  7:00 ` small issue in getifaddrs(3) man page Michael Kerrisk (man-pages)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADFiD2+vbh-rhbj3G8z5F46R6cP1BSOVfpFiJju=EM00Q15-Ug@mail.gmail.com' \
    --to=michael@galassi.us \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).