Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!ukc!its63b!simon From: simon@its63b.ed.ac.uk (ECSC68 S Brown CS) Newsgroups: comp.sources.d Subject: another bug in rogue Message-ID: <340@its63b.ed.ac.uk> Date: Thu, 19-Mar-87 11:49:40 EST Article-I.D.: its63b.340 Posted: Thu Mar 19 11:49:40 1987 Date-Received: Sat, 21-Mar-87 08:55:17 EST Reply-To: simon@its63b.ed.ac.uk (ECSC68 S Brown CS) Organization: I.T. School, Univ. of Edinburgh, U.K. Lines: 57 Well, here's another null-pointer bug in the rogue that was posted recently in comp.sources.unix. (Actually, it was a *REAL* bug - if the first monster on the level was a mimic, it remained mimicking (sp?) even though it should be identified; this patch fixes that too). The symptom of the bug was that if you read a scroll of aggregate monsters on a machine which memory-faults on a null-pointer dereference, the game core-dumps. Here's a context diff: (Yes, I *know* it should be in comp.source.bugs, but I can't post there!) *** monster.c.orig Thu Mar 19 16:41:15 1987 --- monster.c Thu Mar 19 16:41:08 1987 *************** *** 790,796 while (monster) { wake_up(monster); monster->m_flags &= (~IMITATES); - monster = monster->next_monster; if (rogue_can_see(monster->row, monster->col)) { mvaddch(monster->row, monster->col, monster->m_char); } --- 790,795 ----- while (monster) { wake_up(monster); monster->m_flags &= (~IMITATES); if (rogue_can_see(monster->row, monster->col)) { mvaddch(monster->row, monster->col, monster->m_char); } *************** *** 794,799 if (rogue_can_see(monster->row, monster->col)) { mvaddch(monster->row, monster->col, monster->m_char); } } } --- 793,799 ----- if (rogue_can_see(monster->row, monster->col)) { mvaddch(monster->row, monster->col, monster->m_char); } + monster = monster->next_monster; } } -- ---------------------------------- | Simon Brown | UUCP: seismo!mcvax!ukc!{its63b,cstvax}!simon | Department of Computer Science | JANET: simon@uk.ac.ed.{its63b,cstvax} | University of Edinburgh, | ARPA: simon%{its63b,cstvax}.ed.ac.uk\ | Scotland, UK. | @cs.ucl.ac.uk ---------------------------------- "Life's like that, you know"