DragonFly BSD
DragonFly commits List (threaded) for 2004-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/bin/kill


From: Chris Pressey <cpressey@xxxxxxxxxxxxxxx>
Date: Thu, 11 Nov 2004 17:04:33 -0800

On Fri, 12 Nov 2004 00:39:33 +0100
"Douwe Kiela" <virtus@xxxxxxxxxx> wrote:

> "Chris Pressey" <cpressey@xxxxxxxxxxxxxxxxxxxxxxx> schreef:
> -	if (!strcmp(*argv, "-l")) {
> +	if (strcmp(*argv, "-l") == 0) {
> Is this really required by style(9)? I didn't know that, just
> wondering ;-)

Yep :)

"Do not use ! for tests unless it is a boolean, e.g. use

     	if (*p == '\0')

not

     	if (!*p)"

And strcmp() does not in fact return a boolean (although it's an easy
one to forget...)

-Chris



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]