]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
clang-tidy: nullptr where possible.
authorAxel Viala <axel.viala@darnuria.eu>
Sun, 11 Dec 2022 11:41:28 +0000 (12:41 +0100)
committerAxel Viala <axel.viala@darnuria.eu>
Sat, 24 Dec 2022 13:36:19 +0000 (14:36 +0100)
- ldapbackend.cc
- recursor_cache.cc
- recusor_cache.hh
- zoneparser-tng.cc

modules/ldapbackend/ldapbackend.cc
pdns/zoneparser-tng.cc

index 35e5e6f2fa169597ea1403dacaa0390aefd14a5b..f400559e70668f1f1ffb6c3e1e66c585df5b00bc 100644 (file)
@@ -38,8 +38,8 @@ LdapBackend::LdapBackend(const string& suffix)
 
   try {
     d_qname.clear();
-    d_pldap = NULL;
-    d_authenticator = NULL;
+    d_pldap = nullptr;
+    d_authenticator = nullptr;
     d_qlog = arg().mustDo("query-logging");
     d_default_ttl = arg().asNum("default-ttl");
     d_myname = "[LdapBackend]";
@@ -97,7 +97,7 @@ LdapBackend::LdapBackend(const string& suffix)
     g_log << Logger::Error << d_myname << " Caught STL exception: " << e.what() << endl;
   }
 
-  if (d_pldap != NULL) {
+  if (d_pldap != nullptr) {
     delete (d_pldap);
   }
   throw PDNSException("Unable to connect to ldap server");
index 12951790a15438939667a804188def42be6b5973..c8754f366ae155e13ef13f75239b05aecb6ee851 100644 (file)
@@ -80,7 +80,7 @@ void ZoneParserTNG::stackFile(const std::string& fname)
     throw std::system_error(ec, "File '" + fname + "': not a regular file");
   }
   FILE *fp = fdopen(fd, "r");
-  if (!fp) {
+  if (fp == nullptr) {
     int err = errno;
     close(fd);
     std::error_code ec (err, std::generic_category());