Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!mtxinu!unisoft!hoptoad!peora!rtmvax!tarpit!rd From: rd@tarpit.UUCP (Bob Thrush x210) Newsgroups: comp.unix.microport Subject: Re: tgetstr stomps memory in SV/AT 2.4 Message-ID: <2246@tarpit.UUCP> Date: 13 Mar 89 00:40:21 GMT References: <2525@splut.UUCP> Reply-To: rd@tarpit.UUCP (Bob Thrush x210) Organization: Automation Intelligence,Inc; Orlando,FL Lines: 54 Summary:tgetstr is broken in uport 2.3.1 through 2.4 In article <2525@splut.UUCP> jay@splut.UUCP (Jay "you ignorant splut!" Maynard) writes about core dumps when running rn compiled with System V/AT Release 2.4 . > >Is this really a termcap/curses bug? Or is it more esoteric? I'm pretty >sure that it's 2.3- or 2.4-specific, since I'm running rn compiled last >April, and it runs fine (except for the article number problem). Yes, tgetstr is broken in 2.4 and 2.3.1. In <316@tarpit.UUCP> and <322@tarpit.UUCP>, I described this problem. In summary: "tgetstr" should be used as: SYNOPSIS char * tgetstr(id, area) char *id, **area; However, tgetstr behaves as though area is defined as "char *area". My patch to rn's "term.c" merely compensates for the error in tgetstr. (This could be fixed better by passing the #define from the Makefile.) Here is the patch to term.c: ------------ snip here ----------- *** term.c Fri Nov 21 17:39:32 1986 --- term.c.uport Sat Nov 19 23:28:06 1988 *************** *** 33,39 **** --- 33,45 ---- /* guarantee capability pointer != Nullch */ /* (I believe terminfo will ignore the &tmpaddr argument.) */ + #define MICROPORT_286_CURSES_BUG + + #ifdef MICROPORT_286_CURSES_BUG + #define Tgetstr(key) ((tmpstr = tgetstr(key,tcarea)) ? tmpstr : nullstr) + #else #define Tgetstr(key) ((tmpstr = tgetstr(key,&tmpaddr)) ? tmpstr : nullstr) + #endif MICROPORT_286_CURSES_BUG #ifdef PUSHBACK struct keymap { ------------ and here ----------- > >-- >Jay Maynard, EMT-P, K5ZC, PP-ASEL | Never ascribe to malice that which can >uucp: uunet!nuchat! (eieio)| adequately be explained by stupidity. > hoptoad!academ!uhnix1!splut!jay +---------------------------------------- >{killer,bellcore}!texbell! | "Less great!" "Tastes filling!" -- Bob Thrush UUCP: {rtmvax,ucf-cs}!tarpit!rd Automation Intelligence, 1200 W. Colonial Drive, Orlando, Florida 32804