Better to use an OR or an AND when checking for NULLs in C if statements?
- by Crazy Chenz
Came across a line in OpenSSL that made me do a double take...
if (!*pos)
return NULL;
if (!*pos || ((*pos)->flags == FLAGS))
return blah;
Is there a (performance/security/concurrecy) difference in doing that instead of:
if (!*pos)
return NULL;
if (*pos && ((*pos)->flags == FLAGS))
return blah;
Thanks,
Chenz