Path: utzoo!attcan!uunet!samsung!munnari.oz.au!murdu!viccol!timcc From: timcc@csv.viccol.edu.au (Tim Cook) Newsgroups: comp.os.minix Subject: Fix for adventure Message-ID: <6450.27272902@csv.viccol.edu.au> Date: 25 Oct 90 23:03:45 GMT Organization: Computer Services, Victoria College, Melbourne Lines: 37 The version of adventure posted by Robert R. Hall has a bug that I have found. It may not affect Minix users (I have not tested adventure under Minix, I'm so slow, I haven't even upgraded to 1.5 :-), but it makes advent die with a segmentation fault under DYNIX (4.2 bsd derivative). I tracked it down to a routine in database.c that writes -1 into a field of an entry in the travel array, to denote the end of that array (this happens on line 28 of database.c). Unfortunately, it actually writes just past the array, setting the value of a file pointer to -1. This causes a segmentation fault when you try to move at the start of the game. Enough banter, the fix is simple: *** advdef.h.dist Thu Oct 25 14:53:09 1990 --- advdef.h Thu Oct 25 18:12:18 1990 *************** *** 6,12 **** /* Database variables */ ! struct trav travel[MAXTRAV]; FILE *fd1, *fd2, *fd3, *fd4; int actmsg[32]; /* action messages */ --- 6,12 ---- /* Database variables */ ! struct trav travel[MAXTRAV+1]; FILE *fd1, *fd2, *fd3, *fd4; int actmsg[32]; /* action messages */ -- Tim Cook Systems Administrator, Victoria College Computer Services parrot - n. An animal that has the ability to imitate man, but not the intelligence to refrain from doing so.