[quake3-commits] r1731 - trunk/code/botlib
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Wed Nov 4 13:13:05 EST 2009
Author: ludwig
Date: 2009-11-04 13:13:05 -0500 (Wed, 04 Nov 2009)
New Revision: 1731
Modified:
trunk/code/botlib/l_precomp.c
trunk/code/botlib/l_script.c
Log:
fix wrong strcpy usage (#4331, patch by Andreas Bierfert)
Modified: trunk/code/botlib/l_precomp.c
===================================================================
--- trunk/code/botlib/l_precomp.c 2009-11-04 00:42:22 UTC (rev 1730)
+++ trunk/code/botlib/l_precomp.c 2009-11-04 18:13:05 UTC (rev 1731)
@@ -948,7 +948,7 @@
if ((*ptr == '\\' || *ptr == '/') &&
(*(ptr+1) == '\\' || *(ptr+1) == '/'))
{
- strcpy(ptr, ptr+1);
+ memmove(ptr, ptr+1, strlen(ptr));
} //end if
else
{
Modified: trunk/code/botlib/l_script.c
===================================================================
--- trunk/code/botlib/l_script.c 2009-11-04 00:42:22 UTC (rev 1730)
+++ trunk/code/botlib/l_script.c 2009-11-04 18:13:05 UTC (rev 1731)
@@ -1118,7 +1118,7 @@
{
if (*string == '\"')
{
- strcpy(string, string+1);
+ memmove(string, string+1, strlen(string));
} //end if
if (string[strlen(string)-1] == '\"')
{
@@ -1135,7 +1135,7 @@
{
if (*string == '\'')
{
- strcpy(string, string+1);
+ memmove(string, string+1, strlen(string));
} //end if
if (string[strlen(string)-1] == '\'')
{
More information about the quake3-commits
mailing list