Fix strcpy copying buffer into itself, thanks to Simon McVittie for reporting and the patch (#4894)

This commit is contained in:
Thilo Schulz 2011-02-08 23:16:03 +00:00
parent 8a3f2ff805
commit 8cd4b77a1e

View file

@ -1488,7 +1488,8 @@ char *EasyClientName(int client, char *buf, int size) {
char *str1, *str2, *ptr, c;
char name[128];
strcpy(name, ClientName(client, name, sizeof(name)));
ClientName(client, name, sizeof(name));
for (i = 0; name[i]; i++) name[i] &= 127;
//remove all spaces
for (ptr = strstr(name, " "); ptr; ptr = strstr(name, " ")) {