Michael Kerrisk (man-pages) writes ("Re: Bug#848231: bugs in scandir example 
program"):
> tags 848231 fixed-upstream
> thanks
...> 
> On 15 December 2016 at 13:55, Ian Jackson
> >         int
> >         main(void)
> > @@ -18,4 +20,5 @@
> >                 }
> >                 free(namelist);
> >             }
> > +           return 0;
> >         }
> >
> 
> Thanks, Ian. Fixed pretty much as you suggest. The program doesn't
> even compile as it was given! Looks like I injected the error after a
> user report 4 years ago (changed "0" to "NULL").

Thanks.  But, 0 should be 0, not NULL.

NULL is a null pointer constant but main returns int.

(Even if main returned a pointer, 0 would be legal, because 0 is a
valid nll pointer constant, but I guess for pedagogic reasons using
NULL is probaby better in manpages where pointers are meant.)

Ian.

-- 
Ian Jackson <ijack...@chiark.greenend.org.uk>   These opinions are my own.

If I emailed you from an address @fyvzl.net or @evade.org.uk, that is
a private address which bypasses my fierce spamfilter.

Reply via email to