It returns (int)0xffffffff on OSF1 which has 64-bit long, so
`unsigned long address; ... if((address = inet_addr(str)) == -1)' fails.
}
}
- if ( (address = inet_addr( host )) == (unsigned long) -1L ) {
+ address = inet_addr( host );
+ /* This was just a test for -1 until OSF1 let inet_addr return
+ unsigned int, which is narrower than 'unsigned long address' */
+ if ( address == 0xffffffff || address == (unsigned long) -1 ) {
if ( (hp = gethostbyname( host )) == NULL ) {
errno = EHOSTUNREACH;
continue;
connected = use_hp = 0;
- if ( host != NULL && ( address = inet_addr( host )) == (unsigned long) -1L ) {
+ if ( host != NULL ) {
+ address = inet_addr( host );
+ /* This was just a test for -1 until OSF1 let inet_addr return
+ unsigned int, which is narrower than 'unsigned long address' */
+ if ( address == 0xffffffff || address == (unsigned long) -1 ) {
if ( (hp = gethostbyname( host )) == NULL ) {
#ifdef HAVE_WINSOCK
errno = WSAGetLastError();
return( -1 );
}
use_hp = 1;
+ }
}
rc = -1;