[C-safe-secure-studygroup] null check

Robert Seacord rcseacord at gmail.com
Thu Apr 5 20:28:46 BST 2018


Is a null pointer guaranteed (by the C and/or C++ specification) to
evaluate to false?  For example, does the following C++ statement



                Std::string tmp(tmpPtrVal ? tmpPtrVal : “”);



Need to be rewritten as:



                Std::string tmp((tmpPtrVal != NULL) ? tmpPtrVal : “”);

Thanks,
rCs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.trustable.io/pipermail/c-safe-secure-studygroup/attachments/20180405/2978b1b6/attachment.html>


More information about the C-safe-secure-studygroup mailing list