aboutsummaryrefslogtreecommitdiffstats
path: root/dirmngr/dns.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2019-02-26 02:43:10 +0000
committerNIIBE Yutaka <[email protected]>2019-02-26 02:53:41 +0000
commita1ccfe2b37847cce0db2fb94a7365c9fa501eda4 (patch)
treeebdba9acc9f28c687ed59f60abea07023a6bd50f /dirmngr/dns.c
parentlibdns: Avoid using compound literals (4). (diff)
downloadgnupg-a1ccfe2b37847cce0db2fb94a7365c9fa501eda4.tar.gz
gnupg-a1ccfe2b37847cce0db2fb94a7365c9fa501eda4.zip
libdns: Avoid using compound literals (5).
* dirmngr/dns.h (dns_rr_foreach): Don't use dns_rr_i_new. Call dns_rr_grep with NULL. * dirmngr/dns.c (dns_rr_grep): Support NULL for error_. -- Here we still use C99 feature of struct member initialization in dns_rr_foreach, for struct dns_rr_i. Note that in C99, it guarantees non-specified member fields are initialized by zero. So, there's no need to use dns_rr_i_new at all. Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'dirmngr/dns.c')
-rw-r--r--dirmngr/dns.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dirmngr/dns.c b/dirmngr/dns.c
index f6a158789..85fd37fb2 100644
--- a/dirmngr/dns.c
+++ b/dirmngr/dns.c
@@ -3266,7 +3266,8 @@ unsigned dns_rr_grep(struct dns_rr *rr, unsigned lim, struct dns_rr_i *i, struct
return count;
error:
- *error_ = error;
+ if (error_)
+ *error_ = error;
return count;
} /* dns_rr_grep() */