use H_SEQ_INDEX to access a sequence

This commit is contained in:
Sven M. Hallberg 2013-01-15 22:18:33 +01:00
parent 83f4944321
commit 9c10a75f3d

View file

@ -335,8 +335,7 @@ const HParsedToken* act_message(const HParseResult *p) {
struct dns_question *questions = h_arena_malloc(p->arena, struct dns_question *questions = h_arena_malloc(p->arena,
sizeof(struct dns_question)*(header->question_count)); sizeof(struct dns_question)*(header->question_count));
for (size_t i=0; i<header->question_count; ++i) { for (size_t i=0; i<header->question_count; ++i) {
assert(qs->seq->elements[i]->token_type == (HTokenType)TT_dns_question); questions[i] = *H_SEQ_INDEX(dns_question, qs, i);
questions[i] = *(dns_question_t *)qs->seq->elements[i]->user;
} }
msg->questions = questions; msg->questions = questions;