Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!newstop!sun!arthur!djenner From: djenner%arthur@Sun.COM (Doug Jenner) Newsgroups: comp.sources.games.bugs Subject: Display Bug in Castle Keywords: castle, SunOS 4.1 Message-ID: <132387@sun.Eng.Sun.COM> Date: 1 Mar 90 20:28:44 GMT Sender: news@sun.Eng.Sun.COM Lines: 25 An nasty bug where you suddenly go blind- Because of the scheme (albiet, a clever one) for indexing the 'screens' using a 7 character id string (e.g. "1011101" is a straight corridor) it is possible to go suddenly blind. Since the above string is built from indiviual chars, there is no terminating null. Therefore, the atoi(walls) call generates a completely bogus index value as it runs right past the end of the description string. The fix is simple: Make "walls" terminate in a null by adding the line: walls[wall] = '\0'; right after the loop which sets all the initial characters of walls to '0'. The code segment will then look like this: for(wall=0;wall<=6;wall++) walls[wall] = '0'; walls[wall] = '\0'; switch (p->face){