Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/distrib/utils/sysinst
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
Home |
Main Index |
Thread Index |
Old Index