Date: Thu, 7 Mar 2002 06:09:20 -0500 From: Mike Barcroft <mike@FreeBSD.org> To: "David O'Brien" <obrien@FreeBSD.org> Cc: Mark Murray <markm@FreeBSD.org>, 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> In-Reply-To: <20020307030244.B63484@dragon.nuxi.com>; from obrien@FreeBSD.org on Thu, Mar 07, 2002 at 03:02:44AM -0800 References: <200203042027.g24KRc978637@freefall.freebsd.org> <20020307030244.B63484@dragon.nuxi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
David O'Brien <obrien@FreeBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020307060920.C81803>