Skip to content

Commit

Permalink
Fix invalid server-assigned utf8 names with (1) prefix (fixes #3269)
Browse files Browse the repository at this point in the history
  • Loading branch information
def- committed Nov 9, 2020
1 parent 32736f0 commit 225787e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/engine/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 225787e

Please sign in to comment.