If you're relying on a variable being a certain bit length, specify it explicitly. Also, You should just use inet_ntop (or if that's not defined inet_ntoa).

This commit is contained in:
Steve Checkoway
2005-12-12 09:45:58 +00:00
parent 873beb3ff4
commit f164a13d69
+2 -2
View File
@@ -540,8 +540,8 @@ void NetworkSyncManager::Update(float fDeltaTime)
ThisServer.Name = BroadIn.ReadNT();
int port = BroadIn.Read2();
BroadIn.Read2(); //Num players connected.
unsigned long addy = EzSockets::LongFromAddrIn(BroadcastReception->fromAddr);
ThisServer.Address = ssprintf( "%d.%d.%d.%d:%d",
uint32_t addy = EzSockets::LongFromAddrIn(BroadcastReception->fromAddr);
ThisServer.Address = ssprintf( "%u.%u.%u.%u:%d",
(addy<<0)>>24, (addy<<8)>>24, (addy<<16)>>24, (addy<<24)>>24, port );
//It's fairly safe to assume that users will not be on networks with more than