[svn] GnuPG - r5096 - branches/STABLE-BRANCH-1-4/util

svn author dshaw cvs at cvs.gnupg.org
Thu Jul 23 21:05:19 CEST 2009


Author: dshaw
Date: 2009-07-23 21:05:19 +0200 (Thu, 23 Jul 2009)
New Revision: 5096

Modified:
   branches/STABLE-BRANCH-1-4/util/ChangeLog
   branches/STABLE-BRANCH-1-4/util/srv.c
Log:
* srv.c (getsrv): Fix type-punning warning.  (main): Allow testing any
SRV.


Modified: branches/STABLE-BRANCH-1-4/util/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/util/ChangeLog	2009-07-23 18:56:56 UTC (rev 5095)
+++ branches/STABLE-BRANCH-1-4/util/ChangeLog	2009-07-23 19:05:19 UTC (rev 5096)
@@ -1,3 +1,8 @@
+2009-07-23  David Shaw  <dshaw at jabberwocky.com>
+
+	* srv.c (getsrv): Fix type-punning warning.
+	(main): Allow testing any SRV.
+
 2009-07-21  Werner Koch  <wk at g10code.com>
 
 	* ttyio.c (tty_printf): Replace vasprintf by xtryasprintf.

Modified: branches/STABLE-BRANCH-1-4/util/srv.c
===================================================================
--- branches/STABLE-BRANCH-1-4/util/srv.c	2009-07-23 18:56:56 UTC (rev 5095)
+++ branches/STABLE-BRANCH-1-4/util/srv.c	2009-07-23 19:05:19 UTC (rev 5096)
@@ -58,6 +58,7 @@
   int r,srvcount=0;
   unsigned char *pt,*emsg;
   u16 count,dlen;
+  HEADER *header=(HEADER *)answer;
 
   *list=NULL;
 
@@ -65,8 +66,7 @@
   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;
 
@@ -234,7 +234,14 @@
   struct srventry *srv;
   int rc,i;
 
-  rc=getsrv("_hkp._tcp.wwwkeys.pgp.net",&srv);
+  if(argc!=2)
+    {
+      fprintf(stderr,"%s {srv}\n",argv[0]);
+      fprintf(stderr," Try %s _hkp._tcp.wwwkeys.pgp.net\n",argv[0]);
+      return 1;
+    }
+
+  rc=getsrv(argv[1],&srv);
   printf("Count=%d\n\n",rc);
   for(i=0;i<rc;i++)
     {




More information about the Gnupg-commits mailing list