aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/extra
diff options
context:
space:
mode:
authorGravatar Sadie Powell2021-12-03 13:37:42 +0000
committerGravatar Sadie Powell2021-12-03 13:37:42 +0000
commit2466c048e26c09461b4ced2a9dfcf6d87f0e1323 (patch)
treea4575894c6945acef81eb3dd91a206879dbec2ac /src/modules/extra
parentFix a bunch of cases where module types were not marked as final. (diff)
Consistently use `!foo` instead of `foo == NULL`.
Diffstat (limited to 'src/modules/extra')
-rw-r--r--src/modules/extra/m_ldap.cpp4
-rw-r--r--src/modules/extra/m_ssl_gnutls.cpp2
-rw-r--r--src/modules/extra/m_ssl_openssl.cpp4
3 files changed, 5 insertions, 5 deletions
diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp
index 65aca4348..fd3a40148 100644
--- a/src/modules/extra/m_ldap.cpp
+++ b/src/modules/extra/m_ldap.cpp
@@ -370,7 +370,7 @@ class LDAPService final
void Search(LDAPInterface* i, const std::string& base, const std::string& filter) override
{
- if (i == NULL)
+ if (!i)
throw LDAPException("No interface");
LDAPSearch* s = new LDAPSearch(this, i, base, searchscope, filter);
@@ -413,7 +413,7 @@ class LDAPService final
return;
}
- if (req->message == NULL)
+ if (!req->message)
{
return;
}
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp
index 2905794f1..05a7a95fe 100644
--- a/src/modules/extra/m_ssl_gnutls.cpp
+++ b/src/modules/extra/m_ssl_gnutls.cpp
@@ -711,7 +711,7 @@ class GnuTLSIOHook final
unsigned int cert_list_size = 0;
const gnutls_datum_t* cert_list = gnutls_certificate_get_peers(this->sess, &cert_list_size);
- if (cert_list == NULL)
+ if (!cert_list)
{
certinfo->error = "No certificate was found";
goto info_done_dealloc;
diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp
index e70046ea4..7036553f4 100644
--- a/src/modules/extra/m_ssl_openssl.cpp
+++ b/src/modules/extra/m_ssl_openssl.cpp
@@ -81,7 +81,7 @@ namespace OpenSSL
DHParams(const std::string& filename)
{
BIO* dhpfile = BIO_new_file(filename.c_str(), "r");
- if (dhpfile == NULL)
+ if (!dhpfile)
throw Exception("Couldn't open DH file " + filename);
dh = PEM_read_bio_DHparams(dhpfile, NULL, NULL, NULL);
@@ -359,7 +359,7 @@ namespace OpenSSL
const std::string hash = tag->getString("hash", "sha256", 1);
digest = EVP_get_digestbyname(hash.c_str());
- if (digest == NULL)
+ if (!digest)
throw Exception("Unknown hash type " + hash);
const std::string ciphers = tag->getString("ciphers");