diff options
author | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-02-14 04:10:58 +0000 |
---|---|---|
committer | nanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-02-14 04:10:58 +0000 |
commit | de3d8d4c39d6c9ff68d9185138c670990b5a4bf7 (patch) | |
tree | a3c6eaefb4d0607e7299cef81cb8affe6a86aba1 /ace/INET_Addr.cpp | |
parent | fd2ce4c83c6e6a28ae726ebe34a84fdfc2599023 (diff) | |
download | ATCD-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.cpp | 15 |
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; } |