From 9230d548c3d1d1efa9bc069aa65dc0e8c37cabbb Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 5 Feb 2011 17:24:14 +0000 Subject: [PATCH] EasyClientName: don't strcpy a buffer into itself ClientName returns the buffer you passed in, and strcpy'ing overlapping (or in this case, identical) buffers isn't valid. --- code/game/ai_dmq3.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/code/game/ai_dmq3.c b/code/game/ai_dmq3.c index 40cfe14..c10cecd 100644 --- a/code/game/ai_dmq3.c +++ b/code/game/ai_dmq3.c @@ -1488,7 +1488,7 @@ 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, " ")) { -- 1.7.2.3