libdns: Avoid using compound literals (5).
authorNIIBE Yutaka <gniibe@fsij.org>
Tue, 26 Feb 2019 02:43:10 +0000 (11:43 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Tue, 26 Feb 2019 02:53:41 +0000 (11:53 +0900)
commita1ccfe2b37847cce0db2fb94a7365c9fa501eda4
treeebdba9acc9f28c687ed59f60abea07023a6bd50f
parent7313a112f9c7ada61d24285313d2e2d069a672e8
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 <gniibe@fsij.org>
dirmngr/dns.c
dirmngr/dns.h