2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Apply the SET_IF_NOT_NULL() semantic patch

spatch --sp-file cocci/set_if_not_null.spatch --use-gitgrep --dir "." --include-headers --in-place
This commit is contained in:
Tony Finch
2023-04-06 16:32:16 +01:00
committed by Ondřej Surý
parent 0d6dcd217d
commit c622b349e4
28 changed files with 69 additions and 205 deletions

View File

@@ -2633,12 +2633,8 @@ dns_message_peekheader(isc_buffer_t *source, dns_messageid_t *idp,
flags = isc_buffer_getuint16(&buffer);
flags &= DNS_MESSAGE_FLAG_MASK;
if (flagsp != NULL) {
*flagsp = flags;
}
if (idp != NULL) {
*idp = id;
}
SET_IF_NOT_NULL(flagsp, flags);
SET_IF_NOT_NULL(idp, id);
return (ISC_R_SUCCESS);
}
@@ -2786,9 +2782,7 @@ dns_message_gettsig(dns_message_t *msg, const dns_name_t **owner) {
REQUIRE(DNS_MESSAGE_VALID(msg));
REQUIRE(owner == NULL || *owner == NULL);
if (owner != NULL) {
*owner = msg->tsigname;
}
SET_IF_NOT_NULL(owner, msg->tsigname);
return (msg->tsig);
}