[news.software.b] rn 4.3 patch #38

lwall@sdcrdcf.UUCP (Larry Wall) (11/17/86)

System: rn version 4.3
Patch #: 38
Priority: depends
Subject: Rn dumps core on 16 bit USG machines
From: mn-at1!alan (Alan Klietz)

Description:
	Rn dumps core on opening a directory.  This only happens on machines
	that make use of the ndir.c that comes with rn.
	
Repeat by:
	Run rn on a 16 bit System V machine (e.g. Xenix
	or Microport UNIX/V).  Watch it dump core.

Fix:
	The opendir() routine fails to declare malloc() as
	(char *).  This results in a 16 bit value being passed
	to the directory routine when a 32 bit value is really
	required.

	The fix is to declare malloc().

	From rn, say "| patch -d DIR", where DIR is your rn source directory.
	Outside of rn, say "cd DIR; patch <thisarticle".  If you don't have
	the patch program, apply the following by hand, or get patch.

	If patch indicates that patchlevel is the wrong version, you may need
	to apply one or more previous patches, or the patch may already
	have been applied.  See the patchlevel file to find out what has or
	has not been applied.  In any event, don't continue with the patch.

	[Note, I cannot test this patch because rn is being rewritten--law]

	If you are missing previous patches they can be obtained from me:

	Larry Wall
	{allegra,burdvax,cbosgd,hplabs,ihnp4,sdcsvax}!sdcrdcf!lwall

	If you send a mail message of the following form it will greatly speed
	processing:

	Subject: Command
	@SH mailpatch PATH rn 4.3 LIST

	where PATH is a return path FROM ME TO YOU in bang notation, and LIST
	is a list of one or more patches you need, separated by spaces, commas
	and/or hyphens.

Index: patchlevel
Prereq: 37
1c1
< Patch #: 37
---
> Patch #: 38

Index: ndir.c
*** ndir.c.orig	Sun Nov  9 21:04:03 1986
--- ndir.c	Sun Nov  9 21:04:09 1986
***************
*** 34,39
  {
  	register DIR *dirp;
  	register int fd;
  
  	if ((fd = open(name, 0)) == -1)
  		return NULL;

--- 34,40 -----
  {
  	register DIR *dirp;
  	register int fd;
+ 	char *malloc();
  
  	if ((fd = open(name, 0)) == -1)
  		return NULL;