Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site lasspvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!vax135!cornell!lasspvax!cpf From: cpf@lasspvax.UUCP (Footenay Courtman) Newsgroups: net.bugs.4bsd,net.games Subject: Re: Trek Message-ID: <267@lasspvax.UUCP> Date: Mon, 25-Mar-85 15:55:20 EST Article-I.D.: lasspvax.267 Posted: Mon Mar 25 15:55:20 1985 Date-Received: Wed, 27-Mar-85 03:15:26 EST References: <> Reply-To: cpf@lasspvax.UUCP (Courtenay Footman) Organization: LASSP, Cornell University Lines: 26 Xref: watmath net.bugs.4bsd:1429 net.games:1761 Summary: > >I am new at this so please bear with me. We have the game trek that was >distributed with with BSD 4.2. Unfortunately, after playing a few minutes >we get a segmentation fault. > The problem is in the code for events.c. There are three bmove calls right in a row: bmove(Quad,...), bmove(Event,...), bmove(New,...). Quad and Event are arrays, New is a structure. The argument for the third bmove should be &New: i = (int)bmove((char *)Quad, (char *)i, sizeof (Quad)); i = (int)bmove((char *)Event, (char *)i, sizeof(Event)); i = (int)bmove((char *)&Now, (char *)i, sizeof (Now)); I no longer have the original source, so I can not post a diff. I have added all the casts myself, so the thing will pass lint. The source originaly read: i = bmove(Quad, i, sizeof (Quad)); i = bmove(Event, i, sizeof(Event)); i = bmove(Now, i, sizeof (Now)); Note the absence of the ampersand. Segmention faults are the unsuprising result of this bug. Note that the README file is unduly scary; I don't think anything else had to be changed to run on 4.2. I say "I don't think" because I hacked the code until most of it passed lint. -- Courtenay Footman arpa: cpf@lnsvax Newman Lab. of Nuclear Studies usenet: cornell!lnsvax!cpf Cornell University