Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B UNSW 1.1 19 Sep 1984; site csadfa.oz Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!munnari!natmlab!dmscanb!csadfa!cwj From: cwj@csadfa.oz Newsgroups: net.sources.bugs Subject: Re: vtrek Message-ID: <96@csadfa.oz> Date: Mon, 21-Oct-85 21:43:54 EDT Article-I.D.: csadfa.96 Posted: Mon Oct 21 21:43:54 1985 Date-Received: Tue, 22-Oct-85 06:25:41 EDT Organization: CS, Faculty of Military Studies, Uni of NSW, Duntroon, Aust Lines: 36 howard@cyb.eng.UUCP suggests using "tputs(tgoto...))" rather than "fputs(tgoto...)" in vtrek. This is necessary to deal with padding correctly, BUT a vt100 still gets 'J's and no proper cursor positioning, as several people have reported. Reason: insufficient buffer space allocated to the termcap "cl" string (which therefore overwrites "cm" - with a 'J') when calling "tgetstr" in termio.c:terminit function. Minimal Fix: in file termio.c, change declaration "char cl[5];" to "char cl[10];". (The better fix is to use the "char **" parameter to "tgetent" to assist you in allocating space to each entry, as much as it actually needs out of a larger array, along the lines of char * cl, *cm; /* terminal control strings */ char tentries[100]; /* storage area for terminal controls */ ... p = tentries; cl = p; tgetstr("cl", &p); cm = p; tgetstr("cm", &p); -- ---------- -- Chris Johnson ISD: +61 62 68 8170 Dept. Computer Science STD: (062) 68 8170 University College ACSNET: cwj@csadfa.oz Uni. New South Wales UUCP: ...!seismo!munnari!csadfa.oz!cwj or Aust. Defence Force Academy ...!{decvax,pesnta,vax135}!mulga!csadfa.oz!cwj Canberra. ACT. 2600. ARPA: cwj%csadfa.oz@SEISMO.ARPA AUSTRALIA CSNET: cwj@csadfa.oz