[net.bugs.4bsd] Some routines in Mail use variables before they're set

guy@sun.uucp (Guy Harris) (08/10/85)

Index:	ucb/Mail/optim.c 4.2BSD

Description:
	A couple of routines in Mail use pointer variables which have
	never been set.

	One of the routines (rename) is never used.  The code that uses
	it has #ifdef OPTIM around it but is also commented out.  Mail
	is badly in need of "lint"ing.  There are a lot of unused
	variables and functions, a lot of functions which are not properly
	declared, a lot of routines whose return value is never used, etc..
Fix:
	Here's the patch.

*** optim.c.orig	Fri Aug  9 02:52:09 1985
--- optim.c	Fri Aug  9 02:54:09 1985
***************
*** 61,66
  	char buf[BUFSIZ], path[BUFSIZ];
  	register int c, host;
  
  	strcpy(path, "");
  	for (;;) {
  		if ((c = *cp++) == 0)

--- 61,67 -----
  	char buf[BUFSIZ], path[BUFSIZ];
  	register int c, host;
  
+ 	cp = str;
  	strcpy(path, "");
  	for (;;) {
  		if ((c = *cp++) == 0)
***************
*** 651,656
  {
  	register char *cp, *last;
  
  	last = NOSTR;
  	while (*cp) {
  		if (*cp == mach)

--- 652,658 -----
  {
  	register char *cp, *last;
  
+ 	cp = str;
  	last = NOSTR;
  	while (*cp) {
  		if (*cp == mach)