aboutsummaryrefslogtreecommitdiffstats
path: root/common/srv.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/srv.c')
-rw-r--r--common/srv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/srv.c b/common/srv.c
index 9c8977e8e..46d84b583 100644
--- a/common/srv.c
+++ b/common/srv.c
@@ -59,6 +59,7 @@ getsrv(const char *name,struct srventry **list)
int r,srvcount=0;
unsigned char *pt,*emsg;
u16 count,dlen;
+ HEADER *header=(HEADER *)answer;
*list=NULL;
@@ -66,8 +67,7 @@ getsrv(const char *name,struct srventry **list)
if(r<sizeof(HEADER) || r>2048)
return -1;
- if((((HEADER *)answer)->rcode)==NOERROR &&
- (count=ntohs(((HEADER *)answer)->ancount)))
+ if(header->rcode==NOERROR && (count=ntohs(header->ancount)))
{
int i,rc;