use memmove not strcpy when src and test overlap, from ioquake3

This commit is contained in:
Jonathan Gray 2013-04-26 04:40:46 +10:00
parent 59010a333c
commit b393554c11
2 changed files with 3 additions and 3 deletions

View File

@ -947,7 +947,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
{

View File

@ -1103,7 +1103,7 @@ void StripDoubleQuotes(char *string)
{
if (*string == '\"')
{
strcpy(string, string+1);
memmove(string, string+1, strlen(string));
} //end if
if (string[strlen(string)-1] == '\"')
{
@ -1120,7 +1120,7 @@ void StripSingleQuotes(char *string)
{
if (*string == '\'')
{
strcpy(string, string+1);
memmove(string, string+1, strlen(string));
} //end if
if (string[strlen(string)-1] == '\'')
{