|
|
@ -50,9 +50,11 @@ unsigned long IpEndpointName::GetHostByName( const char *s ) |
|
|
|
void IpEndpointName::AddressAsString( char *s ) const |
|
|
|
{ |
|
|
|
if( address == ANY_ADDRESS ){ |
|
|
|
std::sprintf( s, "<any>" ); |
|
|
|
//std::sprintf( s, "<any>" );
|
|
|
|
sprintf_s(s, ADDRESS_STRING_LENGTH, "<any>"); |
|
|
|
}else{ |
|
|
|
std::sprintf( s, "%d.%d.%d.%d", |
|
|
|
//std::sprintf( s, "%d.%d.%d.%d",
|
|
|
|
sprintf_s(s, ADDRESS_STRING_LENGTH, "%d.%d.%d.%d", |
|
|
|
(int)((address >> 24) & 0xFF), |
|
|
|
(int)((address >> 16) & 0xFF), |
|
|
|
(int)((address >> 8) & 0xFF), |
|
|
@ -65,9 +67,11 @@ void IpEndpointName::AddressAndPortAsString( char *s ) const |
|
|
|
{ |
|
|
|
if( port == ANY_PORT ){ |
|
|
|
if( address == ANY_ADDRESS ){ |
|
|
|
std::sprintf( s, "<any>:<any>" ); |
|
|
|
//std::sprintf( s, "<any>:<any>" );
|
|
|
|
sprintf_s(s, ADDRESS_AND_PORT_STRING_LENGTH, "<any>:<any>"); |
|
|
|
}else{ |
|
|
|
std::sprintf( s, "%d.%d.%d.%d:<any>", |
|
|
|
//std::sprintf( s, "%d.%d.%d.%d:<any>",
|
|
|
|
sprintf_s(s, ADDRESS_AND_PORT_STRING_LENGTH, "%d.%d.%d.%d:<any>", |
|
|
|
(int)((address >> 24) & 0xFF), |
|
|
|
(int)((address >> 16) & 0xFF), |
|
|
|
(int)((address >> 8) & 0xFF), |
|
|
@ -75,9 +79,11 @@ void IpEndpointName::AddressAndPortAsString( char *s ) const |
|
|
|
} |
|
|
|
}else{ |
|
|
|
if( address == ANY_ADDRESS ){ |
|
|
|
std::sprintf( s, "<any>:%d", port ); |
|
|
|
//std::sprintf( s, "<any>:%d", port );
|
|
|
|
sprintf_s(s, ADDRESS_AND_PORT_STRING_LENGTH, "<any>:%d", port); |
|
|
|
}else{ |
|
|
|
std::sprintf( s, "%d.%d.%d.%d:%d", |
|
|
|
//std::sprintf( s, "%d.%d.%d.%d:%d",
|
|
|
|
sprintf_s(s, ADDRESS_AND_PORT_STRING_LENGTH, "%d.%d.%d.%d:%d", |
|
|
|
(int)((address >> 24) & 0xFF), |
|
|
|
(int)((address >> 16) & 0xFF), |
|
|
|
(int)((address >> 8) & 0xFF), |
|
|
|