Date: Wed, 29 Oct 2003 11:18:05 +0100 From: Erik Trulsson <ertr1013@student.uu.se> To: Pawel Jakub Dawidek <nick@garage.freebsd.pl> Cc: src-committers@FreeBSD.org Subject: Re: cvs commit: src/lib/libc/rpc clnt_simple.c Message-ID: <20031029101805.GA24695@falcon.midgard.homeip.net> In-Reply-To: <20031029095700.GU84474@garage.freebsd.pl> References: <200310290918.h9T9IiwQ095857@repoman.freebsd.org> <20031029095700.GU84474@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 29, 2003 at 10:57:00AM +0100, Pawel Jakub Dawidek wrote: > On Wed, Oct 29, 2003 at 01:18:44AM -0800, Martin Blapp wrote: > +> Commiter: Martin Blapp <mbr@FreeBSD.org> > > Hi Martin!:) > > +> Log: > +> Don't use NULL to compare against a character. > [...] > +> - if ((nettype == NULL) || (nettype[0] == NULL)) > +> + if ((nettype == NULL) || (nettype[0] == 0)) > > More correct is to use '\0' for characters comparsion. No, not *more* correct. '\0' and 0 are both constants with type "int" and value zero, so they can be used interchangeably. For stylistic reasons one might wish to use '\0' instead of 0 for character comparisons, but the the C language does not make a difference. -- <Insert your favourite quote here.> Erik Trulsson ertr1013@student.uu.se
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031029101805.GA24695>