Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!waikato.ac.nz!canterbury!chem194 From: chem194@csc.canterbury.ac.nz (John Davis) Newsgroups: comp.unix.aix Subject: Re: Why does this fail? [repost] Message-ID: <1991Jun24.104705.1172@csc.canterbury.ac.nz> Date: 23 Jun 91 22:47:05 GMT References: <1991Jun21.143411.21416@siia.mv.com> Organization: Chem Dept, U of Cant, ChCh NZ Lines: 43 In article <1991Jun21.143411.21416@siia.mv.com>, drd@siia.mv.com (David Dick) writes: > The program at the end of this posting produces the following > output when run on the three machines given: > > RESULTS-- > > ARIX (Motorola 68020): > > inch returned 'X' (0x58) > > IBM RS/6000: > > inch returned '' (0x0) > > PROGRAM-- > > /* intst -- simple inch() test */ > > #include > #include > > main() > { > int ch; > > initscr(); > move(10,10); > addch('X'); > move(10,10); > ch = inch(); > endwin(); > printf("inch returned '%c' (0x%0x)\n",ch,ch); > } Welcome to the club - I just found that one too. As far as I can see, stdscr->_y is not being initialised properly (in fact it's nil), resulting in inch() (which derefs _y) grabbing random chars. If you're real lucky you'll segmentation violation!!! ----------------------------------------------------------- | o John Davis - CHEM194@csc.canterbury.ac.nz o | | o (Depart)mental Programmer,Chemistry Department o | | o University of Canterbury, Christchurch, New Zealand o |