Re: small issue in getifaddrs(3) man page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Michael,

On Fri, 28 Feb 2020 at 16:34, Michael Galassi <michael@xxxxxxxxxx> 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/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux