>>>              if (!*dst)
>>
>> As I've noted elsewhere (can't remember if it's where you might have
>> seen it), I dislike punning pointers to Booleans.  But this is a matter
>> of style, and as far as I know nothing can go wrong with it.
>
> I wasn't punning the pointer to bool (which I also do a lot), but the
>  character.  An equivalent exanded version would be `if (*dst == '\0')`.

Even if it were a pointer, it would not be a pun. The C standard
defines if(e), where e is an expression, to switch on the value of
(e)!=0. If e is a pointer, 0 is converted to the null pointer.

(As a matter of programming style, I prefer to use 0 to specify a null
pointer; it doesn't require one to haul in stddef.h as NULL does. And
it doesn't shout.)

Doug

Reply via email to