Re: [RFA] p-typeprint.c, move pointer use to after null-check.

Joel Brobecker
2011-03-08T14:56:51Z

> No, I think that the code relies on the fact that physname
> is never null, but that the constructor or destructor could have no
> parameters, in which case physname would point to \0
> after the '+= 6'.

OK, we agree, in fact:

> Is this correct:
> if (physname && (*physname != 0))
> or is:
> if (physname && *physname != 0)
>
> better?
> or should I use:
> if (physname && *physname != '\0')

My suggestion was to remove the "physname [!= NULL]" part only.
Hence:

if (*physname != '\0')

(I think we have more cases of '\0' than 0 when we're checking
character values)

--
Joel