Return value in cli_initialise wrong?
John E. Malmberg
malmberg at Encompasserve.org
Thu Jun 14 12:29:31 GMT 2001
On Thu, 14 Jun 2001, Tim Potter wrote:
> Joe Doran writes:
>
> > On my hunt to find sspool hanging, memory problems I have been poking
> > around in name resolution functions eg namequery.c, I have come across
> > cli_intialise call in client connect. The function is requiring a
> > boolean false, however the function itself or at least the only
> > reference I can find returns NULL.
> >
> > Is this correct or should it be checking for NULL on return?
> > and if NULL should functions below also be so.
>
> > if(cli_initialise(cli) == False) {
>
> Well False is equal to zero which is equal to NULL so testing a
> pointer against False should be the same as testing it against
> NULL. It's a bit confusing though.
If I understand the C standard correctly, NULL is not guaranteed to be
zero, it just usually is. I could be wrong though.
-John
wb8tyw at qsl.network
Personal Opinion Only
More information about the samba-technical
mailing list