From a38d2e4ab0cc1fd3c274af80216412669d6f3101 Mon Sep 17 00:00:00 2001 From: "Sven M. Hallberg" Date: Wed, 16 Jan 2013 15:06:51 +0100 Subject: [PATCH] replace another field access with a glue macro --- examples/dns.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/dns.c b/examples/dns.c index b513a51..fb2b148 100644 --- a/examples/dns.c +++ b/examples/dns.c @@ -2,7 +2,6 @@ #include #include #include -#include #include "../src/hammer.h" #include "dns_common.h" #include "dns.h" @@ -29,8 +28,7 @@ bool is_zero(HParseResult *p) { bool validate_dns(HParseResult *p) { if (TT_SEQUENCE != p->ast->token_type) return false; - assert(p->ast->seq->elements[0]->token_type == (HTokenType)TT_dns_header); - dns_header_t *header = (dns_header_t *)p->ast->seq->elements[0]->user; + dns_header_t *header = H_FIELD(dns_header, 0); size_t qd = header->question_count; size_t an = header->answer_count; size_t ns = header->authority_count;