1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

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>
(cherry picked from commit a1ccfe2b37)
This commit is contained in:
NIIBE Yutaka 2019-02-26 11:43:10 +09:00 committed by Werner Koch
parent 229302aecf
commit 500151e6da
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
2 changed files with 3 additions and 2 deletions

View file

@ -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() */