use unsigned short instead of unsigned int for port; also use strtol instead of atoi
This commit is contained in:
@@ -107,12 +107,13 @@ void NetworkSyncManager::CloseConnection()
|
|||||||
void NetworkSyncManager::PostStartUp( const RString& ServerIP )
|
void NetworkSyncManager::PostStartUp( const RString& ServerIP )
|
||||||
{
|
{
|
||||||
RString sAddress;
|
RString sAddress;
|
||||||
unsigned int iPort;
|
unsigned short iPort;
|
||||||
|
|
||||||
size_t cLoc = ServerIP.find( ':' );
|
size_t cLoc = ServerIP.find( ':' );
|
||||||
if( ServerIP.find( ':' ) != RString::npos )
|
if( ServerIP.find( ':' ) != RString::npos )
|
||||||
{
|
{
|
||||||
iPort = (unsigned int)atoi( ServerIP.substr( cLoc + 1 ).c_str() );
|
char* cEnd;
|
||||||
|
iPort = (unsigned short)strtol( ServerIP.substr( cLoc + 1 ).c_str(), &cEnd, 10 );
|
||||||
sAddress = ServerIP.substr( 0, cLoc );
|
sAddress = ServerIP.substr( 0, cLoc );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user