Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/inet/inet_network.c
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | if (*cp == '.') { | ||||
goto again; | goto again; | ||||
} | } | ||||
if (*cp && !isspace(*cp&0xff)) | if (*cp && !isspace(*cp&0xff)) | ||||
return (INADDR_NONE); | return (INADDR_NONE); | ||||
*pp++ = val; | *pp++ = val; | ||||
n = pp - parts; | n = pp - parts; | ||||
if (n > 4U) | if (n > 4U) | ||||
return (INADDR_NONE); | return (INADDR_NONE); | ||||
for (val = 0, i = 0; i < n; i++) { | for (val = 0, i = 0; (in_addr_t)i < n; i++) { | ||||
val <<= 8; | val <<= 8; | ||||
val |= parts[i] & 0xff; | val |= parts[i] & 0xff; | ||||
} | } | ||||
return (val); | return (val); | ||||
} | } | ||||
/* | /* | ||||
* Weak aliases for applications that use certain private entry points, | * Weak aliases for applications that use certain private entry points, | ||||
* and fail to include <arpa/inet.h>. | * and fail to include <arpa/inet.h>. | ||||
*/ | */ | ||||
#undef inet_network | #undef inet_network | ||||
__weak_reference(__inet_network, inet_network); | __weak_reference(__inet_network, inet_network); | ||||
/*! \file */ | /*! \file */ |