use unsigned short instead of unsigned int for port; also use strtol instead of atoi

This commit is contained in:
AJ Kelly
2011-03-27 19:06:15 -05:00
parent 178ec08d14
commit cab7c1f077
+3 -2
View File
@@ -107,12 +107,13 @@ void NetworkSyncManager::CloseConnection()
void NetworkSyncManager::PostStartUp( const RString& ServerIP )
{
RString sAddress;
unsigned int iPort;
unsigned short iPort;
size_t cLoc = ServerIP.find( ':' );
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 );
}
else