From owner-freebsd-questions@FreeBSD.ORG Mon Oct 27 22:01:33 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5B051065681 for ; Mon, 27 Oct 2008 22:01:33 +0000 (UTC) (envelope-from carpetsmoker-dated-1225835133.4c4a36@rwxrwxrwx.net) Received: from mail.rwxrwxrwx.net (tournoij.xs4all.nl [80.101.196.202]) by mx1.freebsd.org (Postfix) with ESMTP id 59EB08FC12 for ; Mon, 27 Oct 2008 22:01:33 +0000 (UTC) (envelope-from carpetsmoker-dated-1225835133.4c4a36@rwxrwxrwx.net) Received: from localhost (localhost [127.0.0.1]) by mail.rwxrwxrwx.net (Postfix) with ESMTP id A50406D4D9 for ; Mon, 27 Oct 2008 22:45:50 +0100 (CET) Received: from mail.rwxrwxrwx.net ([127.0.0.1]) by localhost (mail.rwxrwxrwx.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uvKdH0817hHB for ; Mon, 27 Oct 2008 22:45:34 +0100 (CET) Received: by mail.rwxrwxrwx.net (Postfix, from userid 1001) id C735C6D4D8; Mon, 27 Oct 2008 22:45:34 +0100 (CET) Received: by tournoij.xs4all.nl (tmda-sendmail, from uid 1001); Mon, 27 Oct 2008 22:45:33 +0100 Date: Mon, 27 Oct 2008 22:45:32 +0100 To: freebsd-questions@freebsd.org Message-ID: <20081027214532.GA84098@rwxrwxrwx.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Martin Tournoij Mail-Followup-To: freebsd-questions@freebsd.org X-Hashcash: 1:20:081027:freebsd-questions@freebsd.org::pjm69d6a7vkQc8P4:0000000000000000000000000000000012pA Subject: Re: reviving games/freebsd-games X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Martin Tournoij List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2008 22:01:33 -0000 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 for (i=0; i > 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@rwxrwxrwx.net http://www.daemonforums.org QOTD: Q: Why was Stonehenge abandoned? A: It wasn't IBM compatible.