mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix invalid server-assigned utf8 names with (1) prefix (fixes #3269)
This commit is contained in:
parent
32736f0a0f
commit
225787ea39
|
@ -394,7 +394,9 @@ bool CServer::SetClientNameImpl(int ClientID, const char *pNameRequest, bool Set
|
|||
// auto rename
|
||||
for(int i = 1;; i++)
|
||||
{
|
||||
str_format(aNameTry, sizeof(aNameTry), "(%d)%s", i, aTrimmedName);
|
||||
char aNameTryBrokenEnd[MAX_NAME_LENGTH];
|
||||
str_format(aNameTryBrokenEnd, sizeof(aNameTryBrokenEnd), "(%d)%s", i, aTrimmedName);
|
||||
str_utf8_copy(aNameTry, aNameTryBrokenEnd, sizeof(aNameTry));
|
||||
if(IsClientNameAvailable(ClientID, aNameTry))
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue