🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #887

Bug in 1.4 Nethack

#887
From: tytso
Date: Mon, 17 Aug 1987 07:27
66 lines
2982 bytes
When you ask for help for the 'O'ptions, nethack 1.4 coredumps!  The
problem is that with the addition of the DOGNAME, the length of one of
the help "screens" exceeds BUFSZ, which is defined to 256.  Fix is to
change BUFSZ to BUFSIZ, which is (on a vax BSD4.3) defined to 1024.
WARNING!  I'm not certain on the portability of this patch, as I'm not
an expert on what BUFSIZ is defined to on other machines.  In any case,
you could just hard code it.  (boo, hiss)  char toplines[BUFSIZ] only
needs to be about 300 chars, anyway.

Another change needs to be made to hack.c because the BSD 4.3 cc barfs
since it can't to fit a function in a register :-)  Context diffs follow
for both patches. 

Finally, I'd like to make a plea for context diffs!  It makes it a *lot*
easier to install patches, since with ed diffs, there's so little
redundant information I wasn't sure whether I had installed the patch
correctly or not.  The fact that I had to have to original sources wasn't
*that* painful, since it was under RCS, but still...  At the very least,
a posting of the sum(1) of the patched files would be a nice confidence
check.

----------Feed me to patch
*** /tmp/,RCSt1019359	Mon Aug 17 03:20:47 1987
--- topl.c	Mon Aug 17 03:09:57 1987
***************
*** 11,17 ****
  extern char *eos();
  extern int CO;
  
! char toplines[BUFSZ];
  xchar tlx, tly;			/* set by pline; used by addtopl */
  
  struct topl {
--- 11,17 ----
  extern char *eos();
  extern int CO;
  
! char toplines[BUFSIZ];
  xchar tlx, tly;			/* set by pline; used by addtopl */
  
  struct topl {
-----------------
*** /tmp/,RCSt1019743	Mon Aug 17 03:23:08 1987
--- hack.c	Mon Aug 17 01:20:59 1987
***************
*** 86,92 ****
  	register xchar rx, ry;
  	register struct obj *otmp;
  	register struct trap *ttmp;
! 	register struct	monst *mtmp, *m_at();
  
  	while(otmp = sobj_at(ENORMOUS_ROCK, u.ux+u.dx, u.uy+u.dy)) {
  		rx = u.ux+2*u.dx;
--- 86,93 ----
  	register xchar rx, ry;
  	register struct obj *otmp;
  	register struct trap *ttmp;
! 	register struct	monst *mtmp;
! 	struct monst *m_at();
  
  	while(otmp = sobj_at(ENORMOUS_ROCK, u.ux+u.dx, u.uy+u.dy)) {
  		rx = u.ux+2*u.dx;
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Theodore Ts'o				mit-eddie!mit-athena!tytso
3 Ames St., Cambridge, MA 02139		tytso@athena.mit.edu
			If it's for real, it isn't!
Technical Details
Message-ID: <1319@bloom-beacon.MIT.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!ames!think!bloom-beacon!thor!tytso

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!ames!think!bloom-beacon!thor!tytso
From: tytso@thor.UUCP
Newsgroups: comp.sources.bugs
Subject: Bug in 1.4 Nethack
Message-ID: <1319@bloom-beacon.MIT.EDU>
Date: Mon, 17-Aug-87 03:27:31 EDT
Article-I.D.: bloom-be.1319
Posted: Mon Aug 17 03:27:31 1987
Date-Received: Tue, 18-Aug-87 01:48:29 EDT
Sender: daemon@bloom-beacon.MIT.EDU
Reply-To: tytso@thor.UUCP (Theodore Y. Ts'o)
Organization: Massachusetts Institute of Technology
Lines: 66