From 71e9359ed0c4bde56c5bae2a0b69341f6723fc96 Mon Sep 17 00:00:00 2001 From: Erik Ekman Date: Thu, 8 Feb 2007 21:10:46 +0000 Subject: [PATCH] #3 fixed last test, added A char --- tests/dns.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/dns.c b/tests/dns.c index 374c7bf..0e0b9df 100644 --- a/tests/dns.c +++ b/tests/dns.c @@ -113,11 +113,9 @@ START_TEST(test_encode_query) { char buf[512]; char resolv[512]; - char *host = "kryo.se"; struct query q; char *d; int len; - int pos; int ret; len = sizeof(buf); @@ -128,13 +126,13 @@ START_TEST(test_encode_query) q.id = 1337; d = resolv; + *d++ = 'A'; encode_data(queryData, strlen(queryData), 100, d); - pos = strlen(resolv); - d += pos; + d = resolv + strlen(resolv); if (*d != '.') { *d++ = '.'; } - strncpy(d, host, strlen(host)+1); + strcpy(d, topdomain); ret = dns_encode(buf, len, &q, QR_QUERY, resolv, strlen(resolv)); len = sizeof(queryPacket) - 1; // Skip extra null character