trying to simplify an algorithm

Kevin P. Fleming kpfleming at
Tue Mar 1 07:25:26 PST 2005

Hui Zhou wrote:

> I always frowns at statements such as    if (fopen(...))...
> I prefer the usage:
>    if (NULL != fopen(...))...

This is bad, bad, BAD.

Never, ever, ever use NULL to compare to anything that is not a pointer. 
If you are checking for zero, use zero.

More information about the lfs-chat mailing list