From cab7c1f07747494d579ce749c615ea930dcbbe7c Mon Sep 17 00:00:00 2001 From: AJ Kelly Date: Sun, 27 Mar 2011 19:06:15 -0500 Subject: [PATCH] use unsigned short instead of unsigned int for port; also use strtol instead of atoi --- src/NetworkSyncManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/NetworkSyncManager.cpp b/src/NetworkSyncManager.cpp index 697d87e4a5..b58e5a46ff 100644 --- a/src/NetworkSyncManager.cpp +++ b/src/NetworkSyncManager.cpp @@ -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