From e8f5d5055ddf5cf4910ff1c3427dc159197ecf28 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Wed, 4 Nov 2009 18:13:05 +0000 Subject: [PATCH] fix wrong strcpy usage (#4331, patch by Andreas Bierfert) --- code/botlib/l_precomp.c | 2 +- code/botlib/l_script.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/botlib/l_precomp.c b/code/botlib/l_precomp.c index 06dbae77..1fe7c146 100644 --- a/code/botlib/l_precomp.c +++ b/code/botlib/l_precomp.c @@ -948,7 +948,7 @@ void PC_ConvertPath(char *path) if ((*ptr == '\\' || *ptr == '/') && (*(ptr+1) == '\\' || *(ptr+1) == '/')) { - strcpy(ptr, ptr+1); + memmove(ptr, ptr+1, strlen(ptr)); } //end if else { diff --git a/code/botlib/l_script.c b/code/botlib/l_script.c index a579f284..2fe628d3 100644 --- a/code/botlib/l_script.c +++ b/code/botlib/l_script.c @@ -1118,7 +1118,7 @@ void StripDoubleQuotes(char *string) { if (*string == '\"') { - strcpy(string, string+1); + memmove(string, string+1, strlen(string)); } //end if if (string[strlen(string)-1] == '\"') { @@ -1135,7 +1135,7 @@ void StripSingleQuotes(char *string) { if (*string == '\'') { - strcpy(string, string+1); + memmove(string, string+1, strlen(string)); } //end if if (string[strlen(string)-1] == '\'') {