From owner-cvs-all Thu Mar 7 3:14:49 2002 Delivered-To: cvs-all@freebsd.org Received: from espresso.q9media.com (espresso.q9media.com [216.254.138.122]) by hub.freebsd.org (Postfix) with ESMTP id 3F21A37B400; Thu, 7 Mar 2002 03:14:42 -0800 (PST) Received: (from mike@localhost) by espresso.q9media.com (8.11.6/8.11.6) id g27B9K883569; Thu, 7 Mar 2002 06:09:20 -0500 (EST) (envelope-from mike) Date: Thu, 7 Mar 2002 06:09:20 -0500 From: Mike Barcroft To: "David O'Brien" Cc: Mark Murray , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/rwall rwall.c Message-ID: <20020307060920.C81803@espresso.q9media.com> References: <200203042027.g24KRc978637@freefall.freebsd.org> <20020307030244.B63484@dragon.nuxi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020307030244.B63484@dragon.nuxi.com>; from obrien@FreeBSD.org on Thu, Mar 07, 2002 at 03:02:44AM -0800 Organization: The FreeBSD Project Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG David O'Brien writes: > On Mon, Mar 04, 2002 at 12:27:38PM -0800, Mark Murray wrote: > > markm 2002/03/04 12:27:38 PST > > > > Modified files: > > usr.bin/rwall rwall.c > > Log: > > ANSIfication, WARNS and lint cleanup. > > - (void)snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP); > + snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP); > > lint(1) does not like our usage of (void)? Removing it where it already > exists goes against the examples in style(9). I thought the point of (void) was to quiet lint(1). > - if ((fd = mkstemp(tmpname)) == -1 || !(fp = fdopen(fd, "r+"))) > + fd = mkstemp(tmpname); > + fp = fdopen(fd, "r+"); > + if (fd == -1 || !fp) > > Why did you need to do such code restructuring? This introduces a bug where fdopen() could attempt to open a bad file descriptor in the case of an error with mkstemp(). Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message