Date: Tue, 10 Sep 2002 23:07:11 +0100 From: Tony Finch <dot@dotat.at> To: Juli Mallett <jmallett@FreeBSD.org> Cc: Tony Finch <fanf@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/uudecode uudecode.c Message-ID: <20020910230711.A7291@chiark.greenend.org.uk> In-Reply-To: <20020910145812.B78992@FreeBSD.org>; from jmallett@FreeBSD.org on Tue, Sep 10, 2002 at 02:58:12PM -0700 References: <200209102053.g8AKrkvc055026@freefall.freebsd.org> <20020910145812.B78992@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 10, 2002 at 02:58:12PM -0700, Juli Mallett wrote:
> Tony Finch <fanf@FreeBSD.org> wrote:
> >
> > Style: Don't treat pointers as booleans.
>
> Do we have a firm style(9) ruling on that?
Yes.
Test pointers against NULL, e.g., use:
(p = f()) == NULL
not:
!(p = f())
Do not use ! for tests unless it is a boolean, e.g. use
if (*p == '\0')
not
if (!*p)
Tony.
--
f.a.n.finch <dot@dotat.at> http://dotat.at/
FISHER: EAST 4 OR 5, OCCASIONALLY 6 IN NORTH, BUT VARIABLE 3 AT FIRST IN
SOUTH. SHOWERS. MODERATE OR GOOD.
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?20020910230711.A7291>
