nixpkgs/pkgs/games/quake3/game/botlib.patch
Tobias Geerinckx-Rice b825befbdb quake3: add botlib patch for amd64
botlib abuses strcpy (source and dest overlap), and the strcpy function for 64
bit intel CPU's in the latest glibc, does not like this causing the bots to not
load.
2015-07-14 01:03:51 +02:00

51 lines
1.6 KiB
Diff

Retrieved from https://bugzilla.icculus.org/show_bug.cgi?id=4331,
removed path prefix.
-- nckx <tobias.geerinckx.rice@gmail.com>
PATCH: Bots don't work on 64 bit Intel CPU's
botlib abuses strcpy (source and dest overlap), and the strcpy function for 64
bit intel CPU's in the latest glibc, does not like this causing the bots to not
load.
The attached patch fixes this.
Note this patch should be credited to: Andreas Bierfert (andreas.bierfert at
lowlatency.de)
See: http://bugzilla.redhat.com/show_bug.cgi?id=526338
diff -up quake3-1.36/code/botlib/l_precomp.c~ quake3-1.36/code/botlib/l_precomp.c
--- code/botlib/l_precomp.c~ 2009-04-27 08:42:37.000000000 +0200
+++ code/botlib/l_precomp.c 2009-11-03 21:03:08.000000000 +0100
@@ -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 -up quake3-1.36/code/botlib/l_script.c~ quake3-1.36/code/botlib/l_script.c
--- code/botlib/l_script.c~ 2009-04-27 08:42:37.000000000 +0200
+++ code/botlib/l_script.c 2009-11-03 21:06:11.000000000 +0100
@@ -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] == '\'')
{