Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!philabs!prls!amdimage!amdcad!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.bugs.4bsd Subject: Some routines in Mail use variables before they're set Message-ID: <2593@sun.uucp> Date: Fri, 9-Aug-85 18:29:39 EDT Article-I.D.: sun.2593 Posted: Fri Aug 9 18:29:39 1985 Date-Received: Mon, 12-Aug-85 22:06:20 EDT Distribution: net Organization: Sun Microsystems, Inc. Lines: 50 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)