Commit 0671c418 authored by jselbie's avatar jselbie

Use period instead of colon for ip/port delimiter in IPv6 addresses

parent 67c01b76
...@@ -295,6 +295,7 @@ HRESULT CSocketAddress::ToStringBuffer(char* pszAddrBytes, size_t length) const ...@@ -295,6 +295,7 @@ HRESULT CSocketAddress::ToStringBuffer(char* pszAddrBytes, size_t length) const
const char* pszResult = NULL; const char* pszResult = NULL;
const size_t portLength = 6; // colon plus 5 digit string e.g. ":55555" const size_t portLength = 6; // colon plus 5 digit string e.g. ":55555"
char szPort[portLength+1]; char szPort[portLength+1];
char delimiter = (family == AF_INET) ? ':' : '.';
ChkIfA(pszAddrBytes == NULL, E_INVALIDARG); ChkIfA(pszAddrBytes == NULL, E_INVALIDARG);
...@@ -320,7 +321,7 @@ HRESULT CSocketAddress::ToStringBuffer(char* pszAddrBytes, size_t length) const ...@@ -320,7 +321,7 @@ HRESULT CSocketAddress::ToStringBuffer(char* pszAddrBytes, size_t length) const
ChkIf(pszResult == NULL, ERRNOHR); ChkIf(pszResult == NULL, ERRNOHR);
sprintf(szPort, ":%d", GetPort()); sprintf(szPort, "%c%d", delimiter, GetPort());
#if DEBUG #if DEBUG
ChkIfA(strlen(szPort) > portLength, E_FAIL); ChkIfA(strlen(szPort) > portLength, E_FAIL);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment