From feb2aefd88884aa4c084129f87fc36f23e997679 Mon Sep 17 00:00:00 2001 From: mittorn Date: Sun, 5 Jun 2016 08:17:09 +0000 Subject: [PATCH] Fix copying string to itself --- dlls/teamplay_gamerules.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/teamplay_gamerules.cpp b/dlls/teamplay_gamerules.cpp index 9bc7830e..f8a337a1 100644 --- a/dlls/teamplay_gamerules.cpp +++ b/dlls/teamplay_gamerules.cpp @@ -286,7 +286,8 @@ void CHalfLifeTeamplay::ChangePlayerTeam( CBasePlayer *pPlayer, const char *pTea } // copy out the team name from the model - strncpy( pPlayer->m_szTeamName, pTeamName, TEAM_NAME_LENGTH ); + if( pPlayer->m_szTeamName != pTeamName ) + strncpy( pPlayer->m_szTeamName, pTeamName, TEAM_NAME_LENGTH ); g_engfuncs.pfnSetClientKeyValue( clientIndex, g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "model", pPlayer->m_szTeamName ); g_engfuncs.pfnSetClientKeyValue( clientIndex, g_engfuncs.pfnGetInfoKeyBuffer( pPlayer->edict() ), "team", pPlayer->m_szTeamName );