cvs commit: src/lib/libc/rpc clnt_simple.c

Erik Trulsson ertr1013 at student.uu.se
Wed Oct 29 02:18:12 PST 2003


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 at 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 at student.uu.se


More information about the cvs-all mailing list