mirror of
https://github.com/nillerusr/source-engine.git
synced 2024-12-22 14:16:50 +00:00
game: fix UB when reading mapcycle
This commit is contained in:
parent
8acf608b4d
commit
b6cb0c2696
@ -1151,12 +1151,14 @@ ConVarRef suitcharger( "sk_suitcharger" );
|
|||||||
|
|
||||||
void StripChar(char *szBuffer, const char cWhiteSpace )
|
void StripChar(char *szBuffer, const char cWhiteSpace )
|
||||||
{
|
{
|
||||||
|
char *src, *dst;
|
||||||
|
|
||||||
while ( char *pSpace = strchr( szBuffer, cWhiteSpace ) )
|
for (src = dst = szBuffer; *src != '\0'; src++)
|
||||||
{
|
{
|
||||||
char *pNextChar = pSpace + sizeof(char);
|
*dst = *src;
|
||||||
V_strcpy( pSpace, pNextChar );
|
if (*dst != cWhiteSpace) dst++;
|
||||||
}
|
}
|
||||||
|
*dst = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMultiplayRules::GetNextLevelName( char *pszNextMap, int bufsize, bool bRandom /* = false */ )
|
void CMultiplayRules::GetNextLevelName( char *pszNextMap, int bufsize, bool bRandom /* = false */ )
|
||||||
|
Loading…
Reference in New Issue
Block a user