diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/extra/m_ldap.cpp | 4 | ||||
| -rw-r--r-- | src/modules/extra/m_ssl_gnutls.cpp | 2 | ||||
| -rw-r--r-- | src/modules/extra/m_ssl_openssl.cpp | 4 | ||||
| -rw-r--r-- | src/modules/m_filter.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_hostcycle.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_rmode.cpp | 4 | ||||
| -rw-r--r-- | src/modules/m_sasl.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_servprotect.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_spanningtree/fjoin.cpp | 2 | ||||
| -rw-r--r-- | src/modules/m_spanningtree/treeserver.h | 2 |
10 files changed, 13 insertions, 13 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"); diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 27a8b85c0..f32da94ca 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -737,7 +737,7 @@ void ModuleFilter::OnSyncNetwork(ProtocolInterface::Server& server) void ModuleFilter::OnDecodeMetaData(Extensible* target, const std::string &extname, const std::string &extdata) { - if ((target == NULL) && (extname == "filter")) + if ((!target) && (extname == "filter")) { try { diff --git a/src/modules/m_hostcycle.cpp b/src/modules/m_hostcycle.cpp index f30b51993..6f0300c3d 100644 --- a/src/modules/m_hostcycle.cpp +++ b/src/modules/m_hostcycle.cpp @@ -73,7 +73,7 @@ class ModuleHostCycle final for (const auto& [chanuser, _] : c->GetUsers()) { LocalUser* u = IS_LOCAL(chanuser); - if (u == NULL || u == user) + if (!u || u == user) continue; if (u->already_sent == silent_id) continue; diff --git a/src/modules/m_rmode.cpp b/src/modules/m_rmode.cpp index 5690bdb35..9b3fc6cec 100644 --- a/src/modules/m_rmode.cpp +++ b/src/modules/m_rmode.cpp @@ -39,14 +39,14 @@ class CommandRMode final Channel* chan = ServerInstance->Channels.Find(parameters[0]); char modeletter = parameters[1][0]; - if (chan == NULL) + if (!chan) { user->WriteNotice("The channel " + parameters[0] + " does not exist."); return CmdResult::FAILURE; } mh = ServerInstance->Modes.FindMode(modeletter, MODETYPE_CHANNEL); - if (mh == NULL || parameters[1].size() > 1) + if (!mh || parameters[1].size() > 1) { user->WriteNotice(parameters[1] + " is not a valid channel mode."); return CmdResult::FAILURE; diff --git a/src/modules/m_sasl.cpp b/src/modules/m_sasl.cpp index b2c2beaf2..989d2c8da 100644 --- a/src/modules/m_sasl.cpp +++ b/src/modules/m_sasl.cpp @@ -439,7 +439,7 @@ class ModuleSASL final void OnDecodeMetaData(Extensible* target, const std::string& extname, const std::string& extdata) override { - if ((target == NULL) && (extname == "saslmechlist")) + if ((!target) && (extname == "saslmechlist")) cap.SetMechlist(extdata); } }; diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp index feb9aa6ba..3ed739212 100644 --- a/src/modules/m_servprotect.cpp +++ b/src/modules/m_servprotect.cpp @@ -104,7 +104,7 @@ class ModuleServProtectMode final ModResult OnKill(User* src, User* dst, const std::string &reason) override { - if (src == NULL) + if (!src) return MOD_RES_PASSTHRU; if (dst->IsModeSet(bm)) diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp index c945240f1..bc7595eb6 100644 --- a/src/modules/m_spanningtree/fjoin.cpp +++ b/src/modules/m_spanningtree/fjoin.cpp @@ -153,7 +153,7 @@ CmdResult CommandFJoin::Handle(User* srcuser, Params& params) // XXX: If the channel does not exist in the chan hash at this point, create it so the remote modes can be applied on it. // This happens to 0-user permanent channels on the losing side, because those are removed (from the chan hash, then // deleted later) as soon as the permchan mode is removed from them. - if (ServerInstance->Channels.Find(channel) == NULL) + if (!ServerInstance->Channels.Find(channel)) { chan = new Channel(channel, TS); } diff --git a/src/modules/m_spanningtree/treeserver.h b/src/modules/m_spanningtree/treeserver.h index 82aaa1f3c..966dbf9d1 100644 --- a/src/modules/m_spanningtree/treeserver.h +++ b/src/modules/m_spanningtree/treeserver.h @@ -132,7 +132,7 @@ class TreeServer final /** Returns true if this server is the tree root (i.e.: us) */ - bool IsRoot() const { return (this->Parent == NULL); } + bool IsRoot() const { return (!this->Parent); } /** Returns true if this server is locally connected */ |
