Subject: Re: CVS commit: src/distrib/utils/sysinst
To: None <david@l8s.co.uk>
From: None <cgd@broadcom.com>
List: source-changes
Date: 07/21/2003 15:24:27
At Mon, 21 Jul 2003 21:52:45 +0000 (UTC), "David Laight" wrote:
> IMHO the latter is clearer, the test is 'is this string null' not
> 'does it have zero length'.
Can you point me at a definition of what a "null string" is?
empty string? sure. you test that.
NULL string pointer. not what you're checking.
String starts with a NUL character? you test that, too, but that's
the same as "empty string" if you're talking about C strings...
> In any case, even on i386 gcc -O2 generates:
is that a modern gcc, or the ancient one NetBSD ships?
Don't use the latter to justify making tiny "optimizations" to code at
the cost of readability or meaning. Two wrongs don't make a right.
cgd