o Fixed a formatting issue with the server name in the scoreboard.

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@527 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2006-06-05 15:23:04 +00:00
parent 081798e78b
commit 21c44cec9f

View file

@ -405,10 +405,11 @@ void ScorePanel::Update()
char theServerName[MAX_SERVERNAME_LENGTH+1]; char theServerName[MAX_SERVERNAME_LENGTH+1];
if (gViewPort->m_szServerName) if (gViewPort->m_szServerName)
{ {
memset(theServerName, 0, MAX_SERVERNAME_LENGTH+1);
int iServerNameLength = max((int)strlen(gViewPort->m_szServerName),MAX_SERVERNAME_LENGTH); int iServerNameLength = max((int)strlen(gViewPort->m_szServerName),MAX_SERVERNAME_LENGTH);
sprintf(theServerName, "%32s", gViewPort->m_szServerName); strncat(theServerName, gViewPort->m_szServerName, iServerNameLength);
} }
theServerName[MAX_SERVERNAME_LENGTH]=0;
char theMapName[MAX_MAPNAME_LENGTH+1]; char theMapName[MAX_MAPNAME_LENGTH+1];
sprintf(theMapName, "%s", gHUD.GetMapName().c_str()); sprintf(theMapName, "%s", gHUD.GetMapName().c_str());
@ -423,7 +424,7 @@ void ScorePanel::Update()
sprintf(elapsedString, ""); sprintf(elapsedString, "");
} }
sprintf(title, "%s Map: %s %s", theServerName, theMapName, elapsedString); sprintf(title, "%32s Map: %s %s", theServerName, theMapName, elapsedString);
m_TitleLabel.setText(title); m_TitleLabel.setText(title);