Subject: Re: bin/2417: snake won't run (coredumps) due to terminal problem (?)
To: der Mouse <mouse@Collatz.McRCIM.McGill.EDU>
From: Aaron Brown <>
List: netbsd-bugs
Date: 05/16/1996 08:01:04
On Thu, 16 May 1996, der Mouse wrote:
> > When running the game "snake" (/usr/games/snake), it coredumps
> > immediately on startup.  I traced it down to move.c line 646, which
> > does a strlen(BS), where BS is NULL.  If I change this to
> > 	if (BS != NULL)
> > 		BSlength = strlen(BS);
> > 	else
> > 		BSlength = 0;
> This is surely not the right fix.  If the terminal has neither :bc=:
> nor :bs: (see above, where BS is set), then it can't backspace at all.
> Snake is apparently not prepared to deal with terminals that simply
> cannot backspace; your "fix" makes it use a zero-length string as the
> backspace string, which naturally doesn't work right.

Yes, I know it isn't right...see my later comment that it didn't work.
I just did this to make the thing not coredump. If a termcap is missing
the :bs:, and a program requires it, it should at least print an error
message or try to work around it, not coredump. In the source a few lines
after this, it tests to see if BS is null (0, actually...), which seems
strage since it already has used it!

I just didn't have time to figure out a real fix...

> Indeed, I find that the NetBSD termcap file spsecifies neither bc nor
> bs for vt100 and vt220.  This is a serious bug in the termcap file;
> both those terminals should have :bs:.

Yeah, this seems like the real problem.

> If you want to make it work, set BSlength to something really huge,
> like 1000, in the BS==NULL case; then the code will think the BS string
> is so expensive that it will always prefer to use cursor motion.

Ok, will try...