summaryrefslogtreecommitdiff
path: root/ace/INET_Addr.cpp
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-02-14 04:10:58 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1999-02-14 04:10:58 +0000
commitde3d8d4c39d6c9ff68d9185138c670990b5a4bf7 (patch)
treea3c6eaefb4d0607e7299cef81cb8affe6a86aba1 /ace/INET_Addr.cpp
parentfd2ce4c83c6e6a28ae726ebe34a84fdfc2599023 (diff)
downloadATCD-de3d8d4c39d6c9ff68d9185138c670990b5a4bf7.tar.gz
CE changes: Sat Feb 13 22:06:17 1999 Nanbor Wang
Diffstat (limited to 'ace/INET_Addr.cpp')
-rw-r--r--ace/INET_Addr.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp
index 7a1628f518e..555d9641244 100644
--- a/ace/INET_Addr.cpp
+++ b/ace/INET_Addr.cpp
@@ -22,10 +22,9 @@ ACE_INET_Addr::addr_to_string (ASYS_TCHAR s[],
{
ACE_TRACE ("ACE_INET_Addr::addr_to_string");
- size_t total_len =
- ACE_OS::strlen (ipaddr_format == 0 ?
- this->get_host_name () :
- this->get_host_addr ())
+ size_t total_len = (ipaddr_format == 0 ?
+ ACE_OS::strlen (this->get_host_name ()) :
+ ACE_OS::strlen (this->get_host_addr ()))
+ ACE_OS::strlen ("65536") // Assume the max port number.
+ sizeof (':')
+ sizeof ('\0'); // For trailing '\0'.
@@ -34,11 +33,11 @@ ACE_INET_Addr::addr_to_string (ASYS_TCHAR s[],
return -1;
else
{
- ACE_OS::sprintf (s,
+ ACE_OS::sprintf (s,
ASYS_TEXT ("%s:%d"),
- ASYS_WIDE_STRING (ipaddr_format == 0
- ? this->get_host_name ()
- : this->get_host_addr ()),
+ (ipaddr_format == 0
+ ? this->get_host_name ()
+ : ASYS_WIDE_STRING (this->get_host_addr ())),
this->get_port_number ());
return 0;
}