From f895f6c37937c17a73fa2b13211d2d52b94c79e5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 25 Jun 2018 20:05:25 +0200 Subject: [PATCH] move hexcode, eliminate redundant test --- src/util/dnsparser.c | 14 ++++++++------ src/{dns => util}/test_hexcoder.c | 0 2 files changed, 8 insertions(+), 6 deletions(-) rename src/{dns => util}/test_hexcoder.c (100%) diff --git a/src/util/dnsparser.c b/src/util/dnsparser.c index 9ed7e4d0e..55475b131 100644 --- a/src/util/dnsparser.c +++ b/src/util/dnsparser.c @@ -698,7 +698,7 @@ GNUNET_DNSPARSER_parse (const char *udp_payload, if (n > 0) { p->queries = GNUNET_new_array (n, - struct GNUNET_DNSPARSER_Query) ; + struct GNUNET_DNSPARSER_Query); p->num_queries = n; for (unsigned int i=0;iadditional_records[i])) goto error; + } } return p; error: @@ -957,7 +958,6 @@ GNUNET_DNSPARSER_builder_add_cert (char *dst, struct GNUNET_TUN_DnsCertRecord dcert; if ( (cert->cert_type > UINT16_MAX) || - (cert->cert_tag > UINT16_MAX) || (cert->algorithm > UINT8_MAX) ) { GNUNET_break (0); @@ -1045,12 +1045,14 @@ GNUNET_DNSPARSER_builder_add_srv (char *dst, sd.prio = htons (srv->priority); sd.weight = htons (srv->weight); sd.port = htons (srv->port); - GNUNET_memcpy (&dst[*off], &sd, sizeof (sd)); + GNUNET_memcpy (&dst[*off], + &sd, + sizeof (sd)); (*off) += sizeof (sd); if (GNUNET_OK != (ret = GNUNET_DNSPARSER_builder_add_name (dst, - dst_len, - off, - srv->target))) + dst_len, + off, + srv->target))) return ret; return GNUNET_OK; } diff --git a/src/dns/test_hexcoder.c b/src/util/test_hexcoder.c similarity index 100% rename from src/dns/test_hexcoder.c rename to src/util/test_hexcoder.c -- 2.25.1