diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 23ec00b2e..b74a8a76d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -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)