vtrek

cwj at csadfa.oz cwj at csadfa.oz
Tue Oct 22 11:43:54 AEST 1985


howard at 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 at 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 at SEISMO.ARPA
AUSTRALIA		       CSNET:	cwj at csadfa.oz



More information about the Comp.sources.bugs mailing list