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

Pawel Jakub Dawidek nick at garage.freebsd.pl
Wed Oct 29 02:26:07 PST 2003


On Wed, Oct 29, 2003 at 11:18:05AM +0100, Erik Trulsson wrote:
+> > +> -	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.

s/More correct/More correct from style point of view/ of course.
Sorry for the confusion.

-- 
Pawel Jakub Dawidek                       pawel at dawidek.net
UNIX Systems Programmer/Administrator     http://garage.freebsd.pl
Am I Evil? Yes, I Am!                     http://cerber.sourceforge.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 305 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/cvs-all/attachments/20031029/96f6330a/attachment.bin


More information about the cvs-all mailing list