diff --git a/ChangeLog b/ChangeLog index 8bb249d43..251e1aebc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Sun Nov 21 6:35:00 1999 Richard Frith-Macdonald * Source/UnixFileHandle.m: ([-availableData]) fixed to block when no data is availabvle on a comms channel - as per spec. This bug was also reported by Dan + * Source/NSHost.m: Use inet_aton() if available. 1999-11-18 Adam Fedor diff --git a/Source/NSHost.m b/Source/NSHost.m index 9fb0f09dd..e4b244d91 100644 --- a/Source/NSHost.m +++ b/Source/NSHost.m @@ -204,12 +204,18 @@ static NSMutableDictionary*_hostCache = nil; NSLog(@"Nil address sent to +[NSHost hostWithAddress]"); return nil; } - - hostaddr.s_addr = inet_addr((char*)[address cString]); +#ifndef HAVE_INET_ATON + hostaddr.s_addr = inet_addr([address cString]); if (hostaddr.s_addr == -1) { return nil; } +#else + if (inet_aton([address cString], &hostaddr.s_addr) == 0) + { + return nil; + } +#endif h = gethostbyaddr((char*)&hostaddr, sizeof(hostaddr), AF_INET); return [self _hostWithHostEntry: h];