Skip to content

Commit

Permalink
Merge #3285
Browse files Browse the repository at this point in the history
3285: Fix invalid server-assigned utf8 names with (1) prefix (fixes #3269) r=heinrich5991 a=def-

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
  • Loading branch information
bors[bot] and def- committed Nov 9, 2020
2 parents 8dd1cd5 + 225787e commit b44bcd7
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 b44bcd7

Please sign in to comment.