Add missing conditions to CleanupPlayerName
This commit is contained in:
parent
4b1a402731
commit
ab8eed6efb
|
@ -1010,6 +1010,17 @@ static void CleanupPlayerName(INT32 playernum, const char *newname)
|
||||||
|
|
||||||
tmpname = p;
|
tmpname = p;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
/* from EnsurePlayerNameIsGood */
|
||||||
|
if (!isprint(*p) || *p == ';' || (UINT8)*p >= 0x80)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
while (*++p) ;
|
||||||
|
|
||||||
|
if (*p)/* bad char found */
|
||||||
|
break;
|
||||||
|
|
||||||
// Remove trailing spaces.
|
// Remove trailing spaces.
|
||||||
p = &tmpname[strlen(tmpname)-1]; // last character
|
p = &tmpname[strlen(tmpname)-1]; // last character
|
||||||
while (*p == ' ' && p >= tmpname)
|
while (*p == ' ' && p >= tmpname)
|
||||||
|
|
Loading…
Reference in New Issue