gethostbyname call with 0 length arg

James Hawkins truiken at gmail.com
Wed Feb 8 11:10:50 CST 2006


On 2/8/06, Detlef Riekenberg <wine.dev at web.de> wrote:
> Am Freitag, den 03.02.2006, 19:23 +0100 schrieb Christer Palm:
>
> > > if((!name) && (name[0])) {
> > Do you really mean that?
> > "if name is 0, then dereference name"?
> No. the code is:
>
> "if name is not NULL, then dereference name"
>

Consider the case when name is NULL:

!name = TRUE

if (TRUE && name[0])

So the only time you'll dereference name is when name is NULL.  It should read:

if (name && name[0])

--
James Hawkins



More information about the wine-devel mailing list