Date: Sun, 21 Jul 2002 21:29:54 +1000 (EST) From: Edwin Groothuis <edwin@mavetju.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/40832: [patch] games/race doesn't work due to FreeBSD specific patch Message-ID: <20020721112954.402C36A711E@k7.mavetju>
next in thread | raw e-mail | index | archive | help
>Number: 40832 >Category: ports >Synopsis: [patch] games/race doesn't work due to FreeBSD specific patch >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jul 21 04:40:02 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Edwin Groothuis >Release: FreeBSD 4.5-RELEASE i386 >Organization: - >Environment: System: FreeBSD k7.mavetju 4.5-RELEASE FreeBSD 4.5-RELEASE #3: Mon Mar 11 13:32:05 EST 2002 edwin@k7.mavetju.org:/usr/src/sys/compile/k7 i386 $FreeBSD: ports/games/race/Makefile,v 1.1 2002/07/16 16:00:15 ijliao Exp $ >Description: games/race crashes when it tries to load one of its datafiles. >How-To-Repeat: install games/race and try to run a game . >Fix: games/race tries to be smart and allocates a string of 6+strlen() of two variables. This goes fine it the fixed 6 is the length of "/data/". But how about it if the patch changes /data/ into %%DATADIR%%, which is later on expanded to /usr/local/share/race ? This patch gives the allocated string a length of 60, which should be (include famous last words here) long enough for the string. --- files/old-textures.c Sun Jul 21 21:07:41 2002 +++ files/patch-textures.c Sun Jul 21 21:16:50 2002 @@ -1,8 +1,11 @@ ---- src/textures.c.orig Tue Jul 16 23:50:37 2002 -+++ src/textures.c Tue Jul 16 23:50:46 2002 -@@ -35,7 +35,7 @@ +--- src/textures.c.orig Fri Mar 8 01:44:46 2002 ++++ src/textures.c Sun Jul 21 21:14:50 2002 +@@ -33,9 +33,9 @@ + + int loadtexture(char *dir, char *file, int filter, int repeat, int id){ SDL_Surface *image; - char location[6+strlen(dir)+strlen(file)]; +- char location[6+strlen(dir)+strlen(file)]; ++ char location[60+strlen(dir)+strlen(file)]; - sprintf(location,"data/%s/%s",dir,file); + sprintf(location,"%%DATADIR%%/data/%s/%s",dir,file); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020721112954.402C36A711E>