Skip to content

Commit

Permalink
fix possible malformed server name?
Browse files Browse the repository at this point in the history
  • Loading branch information
TsFreddie committed Jan 2, 2025
1 parent 924fb57 commit 946e88a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/engine/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,7 @@ void CServer::CacheServerInfo(CCache *pCache, int Type, bool SendClients)

// One chance to improve the protocol!
CPacker p;
char aBuf[128];
char aBuf[256];

// count the players
int PlayerCount = 0, ClientCount = 0;
Expand Down Expand Up @@ -1836,7 +1836,7 @@ void CServer::CacheServerInfo(CCache *pCache, int Type, bool SendClients)
p.AddString(GameServer()->Version(), 32);
if(Type != SERVERINFO_VANILLA)
{
if(ClientCount >= FAKE_MAX_CLIENTS)
if(m_NetServer.MaxClients() >= FAKE_MAX_CLIENTS)
{
str_format(aBuf, sizeof(aBuf), "%s [%d/%d]", g_Config.m_SvName, ClientCount, m_NetServer.MaxClients());
p.AddString(aBuf, 256);
Expand Down

0 comments on commit 946e88a

Please sign in to comment.