Add missing conditions to CleanupPlayerName

This commit is contained in:
James R 2020-02-01 18:10:58 -08:00
parent 4b1a402731
commit ab8eed6efb
1 changed files with 11 additions and 0 deletions

View File

@ -1010,6 +1010,17 @@ static void CleanupPlayerName(INT32 playernum, const char *newname)
tmpname = p;
do
{
/* from EnsurePlayerNameIsGood */
if (!isprint(*p) || *p == ';' || (UINT8)*p >= 0x80)
break;
}
while (*++p) ;
if (*p)/* bad char found */
break;
// Remove trailing spaces.
p = &tmpname[strlen(tmpname)-1]; // last character
while (*p == ' ' && p >= tmpname)