diff --git a/bin/dnssec/dnssectool.c b/bin/dnssec/dnssectool.c index da1fffa400..48c09e9d48 100644 --- a/bin/dnssec/dnssectool.c +++ b/bin/dnssec/dnssectool.c @@ -460,9 +460,7 @@ key_collision(dst_key_t *dstkey, dns_name_t *name, const char *dir, dns_secalg_t alg; isc_stdtime_t now = isc_stdtime_now(); - if (exact != NULL) { - *exact = false; - } + SET_IF_NOT_NULL(exact, false); id = dst_key_id(dstkey); rid = dst_key_rid(dstkey); diff --git a/lib/dns/message.c b/lib/dns/message.c index 44e0c6ab7c..bb83ff41d7 100644 --- a/lib/dns/message.c +++ b/lib/dns/message.c @@ -2551,9 +2551,7 @@ dns_message_findname(dns_message_t *msg, dns_section_t section, return result; } - if (name != NULL) { - *name = foundname; - } + SET_IF_NOT_NULL(name, foundname); /* * And now look for the type. diff --git a/lib/dns/private.c b/lib/dns/private.c index b1718fbdb1..b5606f6b85 100644 --- a/lib/dns/private.c +++ b/lib/dns/private.c @@ -138,12 +138,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver, if (dns_rdataset_isassociated(&nsecset) && dns_rdataset_isassociated(&nsec3paramset)) { - if (build_nsec != NULL) { - *build_nsec = true; - } - if (build_nsec3 != NULL) { - *build_nsec3 = true; - } + SET_IF_NOT_NULL(build_nsec, true); + SET_IF_NOT_NULL(build_nsec3, true); goto success; } @@ -160,12 +156,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver, * Look to see if we also need to be creating a NSEC3 chain. */ if (dns_rdataset_isassociated(&nsecset)) { - if (build_nsec != NULL) { - *build_nsec = true; - } - if (build_nsec3 != NULL) { - *build_nsec3 = false; - } + SET_IF_NOT_NULL(build_nsec, true); + SET_IF_NOT_NULL(build_nsec3, false); if (!dns_rdataset_isassociated(&privateset)) { goto success; } @@ -194,12 +186,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver, } if (dns_rdataset_isassociated(&nsec3paramset)) { - if (build_nsec3 != NULL) { - *build_nsec3 = true; - } - if (build_nsec != NULL) { - *build_nsec = false; - } + SET_IF_NOT_NULL(build_nsec3, true); + SET_IF_NOT_NULL(build_nsec, false); if (!dns_rdataset_isassociated(&privateset)) { goto success; } @@ -264,12 +252,8 @@ dns_private_chains(dns_db_t *db, dns_dbversion_t *ver, goto success; } - if (build_nsec != NULL) { - *build_nsec = false; - } - if (build_nsec3 != NULL) { - *build_nsec3 = false; - } + SET_IF_NOT_NULL(build_nsec, false); + SET_IF_NOT_NULL(build_nsec3, false); if (!dns_rdataset_isassociated(&privateset)) { goto success; } diff --git a/lib/dns/view.c b/lib/dns/view.c index fb354d3ad7..d2f21ee8ba 100644 --- a/lib/dns/view.c +++ b/lib/dns/view.c @@ -1599,9 +1599,7 @@ dns_view_issecuredomain(dns_view_t *view, const dns_name_t *name, return result; } - if (ntap != NULL) { - *ntap = false; - } + SET_IF_NOT_NULL(ntap, false); if (checknta && secure && view->ntatable_priv != NULL && dns_ntatable_covered(view->ntatable_priv, now, name, anchor)) { diff --git a/lib/isccfg/aclconf.c b/lib/isccfg/aclconf.c index 03030aa898..0f382dca7b 100644 --- a/lib/isccfg/aclconf.c +++ b/lib/isccfg/aclconf.c @@ -209,9 +209,7 @@ count_acl_elements(const cfg_obj_t *caml, const cfg_obj_t *cctx, REQUIRE(count != NULL); - if (has_negative != NULL) { - *has_negative = false; - } + SET_IF_NOT_NULL(has_negative, false); for (elt = cfg_list_first(caml); elt != NULL; elt = cfg_list_next(elt)) {