Modernize use nullptr
NULL => nullptr as per modernize-use-nullptr.
After this change:
```
grep "NULL" -r */*.*pp *.*pp
None
```
Signed-off-by: Nan Zhou <nanzhoumails@gmail.com>
Change-Id: Iecddab6fba06f959866048eff4496310453d0fde
diff --git a/certificate.cpp b/certificate.cpp
index 0e19141..88ff65e 100644
--- a/certificate.cpp
+++ b/certificate.cpp
@@ -90,8 +90,8 @@
std::string
Certificate::generateUniqueFilePath(const std::string& directoryPath)
{
- char* filePath = tempnam(directoryPath.c_str(), NULL);
- if (filePath == NULL)
+ char* filePath = tempnam(directoryPath.c_str(), nullptr);
+ if (filePath == nullptr)
{
log<level::ERR>(
"Error occurred while creating random certificate file path",
@@ -293,8 +293,8 @@
elog<InternalFailure>();
}
- errCode =
- X509_STORE_CTX_init(storeCtx.get(), x509Store.get(), cert.get(), NULL);
+ errCode = X509_STORE_CTX_init(storeCtx.get(), x509Store.get(), cert.get(),
+ nullptr);
if (errCode != 1)
{
log<level::ERR>("Error occurred during X509_STORE_CTX_init call",
@@ -526,7 +526,7 @@
// Go through each usage in the bit string and convert to
// corresponding string value
if ((usage = static_cast<ASN1_BIT_STRING*>(
- X509_get_ext_d2i(cert.get(), NID_key_usage, NULL, NULL))))
+ X509_get_ext_d2i(cert.get(), NID_key_usage, nullptr, nullptr))))
{
for (auto i = 0; i < usage->length; ++i)
{
@@ -542,8 +542,8 @@
}
EXTENDED_KEY_USAGE* extUsage;
- if ((extUsage = static_cast<EXTENDED_KEY_USAGE*>(
- X509_get_ext_d2i(cert.get(), NID_ext_key_usage, NULL, NULL))))
+ if ((extUsage = static_cast<EXTENDED_KEY_USAGE*>(X509_get_ext_d2i(
+ cert.get(), NID_ext_key_usage, nullptr, nullptr))))
{
for (int i = 0; i < sk_ASN1_OBJECT_num(extUsage); i++)
{