summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-03 15:35:49 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-03 15:35:49 +0000
commit76928d4f35100beb3f99f61134aa43f063621a2d (patch)
treefbf0e5172fdaa315f15f9f22362e4ce50eedb10a
parent02ae92c8a5db52d9cf190a1c7c9b61c10760097b (diff)
downloadATCD-76928d4f35100beb3f99f61134aa43f063621a2d.tar.gz
(inet_aton): return 0 if addr argument is 0
-rw-r--r--ace/OS.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/ace/OS.cpp b/ace/OS.cpp
index e72f3fe73e6..73305ba15f5 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -3032,17 +3032,18 @@ int
ACE_OS::inet_aton (const char *host_name, struct in_addr *addr)
{
ACE_UINT32 ip_addr = ACE_OS::inet_addr (host_name);
+
if (ip_addr == (ACE_UINT32) htonl ((ACE_UINT32) ~0)
// Broadcast addresses are weird...
&& ACE_OS::strcmp (host_name, "255.255.255.255") != 0)
return 0;
- else if (addr != 0)
+ else if (addr == 0)
+ return 0;
+ else
{
ACE_OS::memcpy ((void *) addr, (void *) &ip_addr, sizeof ip_addr);
return 1;
}
- else
- return 1;
}
ssize_t