* srv.c (getsrv): Fix type-punning warning.
authorDavid Shaw <dshaw@jabberwocky.com>
Thu, 23 Jul 2009 18:56:56 +0000 (18:56 +0000)
committerDavid Shaw <dshaw@jabberwocky.com>
Thu, 23 Jul 2009 18:56:56 +0000 (18:56 +0000)
common/ChangeLog
common/srv.c

index 56e9712..c056c4c 100644 (file)
@@ -1,3 +1,7 @@
+2009-07-23  David Shaw  <dshaw@jabberwocky.com>
+
+       * srv.c (getsrv): Fix type-punning warning.
+
 2009-07-23  Werner Koch  <wk@g10code.com>
 
        * util.h (GPG_ERR_NOT_ENABLED): New.
index 9c8977e..46d84b5 100644 (file)
@@ -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;