diff options
author | NIIBE Yutaka <[email protected]> | 2019-02-26 01:04:09 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-03-07 12:01:47 +0000 |
commit | ff7d01fc6d396fc3b8d37baa9bd4cdebc8853648 (patch) | |
tree | 8d1f886452a56f0295221ca94a525ad00827f02a /dirmngr/dns.c | |
parent | libdns: Avoid using compound literals. (diff) | |
download | gnupg-ff7d01fc6d396fc3b8d37baa9bd4cdebc8853648.tar.gz gnupg-ff7d01fc6d396fc3b8d37baa9bd4cdebc8853648.zip |
libdns: Avoid using compound literals (2).
* dirmngr/dns.h (dns_strsection1, dns_strsection3): Remove.
(dns_strclass1, dns_strclass3): Remove.
(dns_strtype1, dns_strtype3): Remove.
(dns_strsection, dns_strclass, dns_strtype): Directly use the
function.
* dirmngr/dns.c (dns_strsection): Use automatic variable.
(dns_strclass, dns_strtype): Likewise.
Signed-off-by: NIIBE Yutaka <[email protected]>
(cherry picked from commit 455ef62d29a112de05897139716265d07e4c6ae3)
Diffstat (limited to '')
-rw-r--r-- | dirmngr/dns.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/dirmngr/dns.c b/dirmngr/dns.c index 0f6bb4347..83e9d3a25 100644 --- a/dirmngr/dns.c +++ b/dirmngr/dns.c @@ -10086,8 +10086,9 @@ static const struct { { "AR", DNS_S_ADDITIONAL }, }; -const char *(dns_strsection)(enum dns_section section, void *_dst, size_t lim) { - struct dns_buf dst = DNS_B_INTO(_dst, lim); +const char *(dns_strsection)(enum dns_section section) { + char _dst[DNS_STRMAXLEN + 1] = { 0 }; + struct dns_buf dst = DNS_B_INTO(_dst, sizeof _dst); unsigned i; for (i = 0; i < lengthof(dns_sections); i++) { @@ -10135,8 +10136,9 @@ static const struct { { "IN", DNS_C_IN }, }; -const char *(dns_strclass)(enum dns_class type, void *_dst, size_t lim) { - struct dns_buf dst = DNS_B_INTO(_dst, lim); +const char *(dns_strclass)(enum dns_class type) { + char _dst[DNS_STRMAXLEN + 1] = { 0 }; + struct dns_buf dst = DNS_B_INTO(_dst, sizeof _dst); unsigned i; for (i = 0; i < lengthof(dns_classes); i++) { @@ -10171,8 +10173,9 @@ enum dns_class dns_iclass(const char *name) { } /* dns_iclass() */ -const char *(dns_strtype)(enum dns_type type, void *_dst, size_t lim) { - struct dns_buf dst = DNS_B_INTO(_dst, lim); +const char *(dns_strtype)(enum dns_type type) { + char _dst[DNS_STRMAXLEN + 1] = { 0 }; + struct dns_buf dst = DNS_B_INTO(_dst, sizeof _dst); unsigned i; for (i = 0; i < lengthof(dns_rrtypes); i++) { |