From owner-cvs-all Tue Sep 10 15: 7:19 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0597E37B400; Tue, 10 Sep 2002 15:07:14 -0700 (PDT) Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [212.135.138.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9C2C643E42; Tue, 10 Sep 2002 15:07:12 -0700 (PDT) (envelope-from fanf@chiark.greenend.org.uk) Received: from fanf by chiark.greenend.org.uk with local (Exim 3.12 #1) id 17otA7-0003qh-00 (Debian); Tue, 10 Sep 2002 23:07:11 +0100 Date: Tue, 10 Sep 2002 23:07:11 +0100 From: Tony Finch To: Juli Mallett Cc: Tony Finch , 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> References: <200209102053.g8AKrkvc055026@freefall.freebsd.org> <20020910145812.B78992@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020910145812.B78992@FreeBSD.org>; from jmallett@FreeBSD.org on Tue, Sep 10, 2002 at 02:58:12PM -0700 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 On Tue, Sep 10, 2002 at 02:58:12PM -0700, Juli Mallett wrote: > Tony Finch 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 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