From owner-cvs-all Fri Apr 28 18:18:59 2000 Delivered-To: cvs-all@freebsd.org Received: from css-1.cs.iastate.edu (css-1.cs.iastate.edu [129.186.3.24]) by hub.freebsd.org (Postfix) with ESMTP id 7DB4A37BF68; Fri, 28 Apr 2000 18:18:53 -0700 (PDT) (envelope-from ghelmer@cs.iastate.edu) Received: from popeye.cs.iastate.edu (ghelmer@popeye.cs.iastate.edu [129.186.3.4]) by css-1.cs.iastate.edu (8.9.0/8.9.0) with ESMTP id UAA04590; Fri, 28 Apr 2000 20:18:54 -0500 (CDT) Received: from localhost (ghelmer@localhost) by popeye.cs.iastate.edu (8.9.0/8.9.0) with ESMTP id UAA13677; Fri, 28 Apr 2000 20:18:50 -0500 (CDT) X-Authentication-Warning: popeye.cs.iastate.edu: ghelmer owned process doing -bs Date: Fri, 28 Apr 2000 20:18:49 -0500 (CDT) From: Guy Helmer To: Ben Smithurst Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/cron/lib env.c In-Reply-To: <20000428221611.D17098@strontium.scientia.demon.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, 28 Apr 2000, Ben Smithurst wrote: > Guy Helmer wrote: > > > Use consistent types in sizeof when malloc'ing memory for the > > environment. > > - p = (char **) malloc((count+1) * sizeof(char *)); /* 1 for the NULL */ > + p = (char **) malloc((count+1) * sizeof(char **)); /* 1 for the NULL */ > > uh, I think this change is wrong. As p is a 'char **' you are > allocating space for 'char *' values, not 'char **' values. Not that it > really matters, except from a style point of view. Yes, you are right. There are two other places in env.c where it was already "sizeof(char **)"; I first changed those to "sizeof(char *)" but then convinced myself those two were right and this one place was wrong. I'll get to it Sunday unless someone believes this requires immediate attention. Thanks, Guy Guy Helmer, Ph.D. Candidate, Iowa State University Dept. of Computer Science Research Assistant, Dept. of Computer Science --- ghelmer@cs.iastate.edu http://www.cs.iastate.edu/~ghelmer To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message