cvs commit: src/bin/kill

Chris Pressey cpressey at catseye.mine.nu
Thu Nov 11 17:02:49 PST 2004


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

> "Chris Pressey" <cpressey at 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





More information about the Commits mailing list