Re: gethostbyname() issue
Re: gethostbyname() issue
- Subject: Re: gethostbyname() issue
- From: Edward Fink <email@hidden>
- Date: Fri, 1 Nov 2002 14:56:44 -0500
Actually...your right. For some reason I couldn't use it....trying to
get it to display NULL in a printf or NSLog.....or just using the value
would cause a crash. But I did just get an IF test to work correctly
comparing against NULL.....for some reason I was unable to do this
before? Anyways...thanks for your helping me solve this. I'm still
interested on why it is NULL?
Ed...
Exactly how are you verifying this? Can you give me your exact code?
Using either h_addr or h_addr_list[0] cause me a crash....I cannot
even do the check for NULL...as it crashes during the check.
thanks.
I do check for NULL and unfortunately it isn't NULL. In fact all
other values in the hostent returned are set to some value. When I
check the h_addr value however that's when the crash occurs.
I just did a test, and on my system, h_addr is NULL for
gethostbyname("irc.hagabard.com"). h_addr is actually a macro for
h_addr_list[0], and the man page for gethostbyname says that
h_addr_list is a NULL terminated list of addresses. In this case
gethostbyname is returning a NULL terminated list of 0 addresses.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.