reviving games/freebsd-games
Martin Tournoij
carpetsmoker at rwxrwxrwx.net
Mon Oct 27 15:01:33 PDT 2008
On Mon, Oct 27, 2008 at 08:53:46PM +0100, clemens fischer wrote:
> Some of the programs in games/freebsd-games, notably hack and larn, have
> the following problem: Given the declarations:
>
> char *scrollname[] = { char *potionname[] = {
> "\0enchant armor", "\0sleep",
> "\0enchant weapon", "\0healing",
> ... ...
> "\0 " "\0 "
> }; };
>
> (in larn/data.c) the code continues to flag the availability of some
> scroll or potion by writing into the first byte of the strings in these
> arrays:
>
> for (i=0; i<MAXSCROLL; i++) scrollname[i][0]=' ';
> for (i=0; i<MAXPOTION; i++) potionname[i][0]=' ';
>
> This leads to SIGSEGV crashes. I think this came about with the gcc-4xx
> series of our compiler, but I'm not really sure. I verified that
> scrollname and potionname reside in the writable .data segment. The
> segv is reproducable. Does anybody know what is wrong with this code?
> I assume i could arrange for the flagging to be done in a separate data
> structure, but since the programs worked for years this way, I think
> there should be an easier way.
>
> -c
The DragonflyBSD games have many improvements/bugfixes ... I already ported it
some time ago, I just need to finish and wrap up ... I'll do it this weekend.
--
Martin Tournoij
carpetsmoker at rwxrwxrwx.net
http://www.daemonforums.org
QOTD:
Q: Why was Stonehenge abandoned? A: It wasn't IBM
compatible.
More information about the freebsd-questions
mailing list