mirror of
git://git.gnupg.org/gnupg.git
synced 2024-11-10 21:38:50 +01:00
* srv.c (getsrv): Fix type-punning warning. (main): Allow testing any
SRV.
This commit is contained in:
parent
6d755a83b4
commit
63fb9d249a
@ -1,3 +1,8 @@
|
|||||||
|
2009-07-23 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
|
* srv.c (getsrv): Fix type-punning warning.
|
||||||
|
(main): Allow testing any SRV.
|
||||||
|
|
||||||
2009-07-21 Werner Koch <wk@g10code.com>
|
2009-07-21 Werner Koch <wk@g10code.com>
|
||||||
|
|
||||||
* ttyio.c (tty_printf): Replace vasprintf by xtryasprintf.
|
* ttyio.c (tty_printf): Replace vasprintf by xtryasprintf.
|
||||||
|
13
util/srv.c
13
util/srv.c
@ -58,6 +58,7 @@ getsrv(const char *name,struct srventry **list)
|
|||||||
int r,srvcount=0;
|
int r,srvcount=0;
|
||||||
unsigned char *pt,*emsg;
|
unsigned char *pt,*emsg;
|
||||||
u16 count,dlen;
|
u16 count,dlen;
|
||||||
|
HEADER *header=(HEADER *)answer;
|
||||||
|
|
||||||
*list=NULL;
|
*list=NULL;
|
||||||
|
|
||||||
@ -65,8 +66,7 @@ getsrv(const char *name,struct srventry **list)
|
|||||||
if(r<sizeof(HEADER) || r>2048)
|
if(r<sizeof(HEADER) || r>2048)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if((((HEADER *)answer)->rcode)==NOERROR &&
|
if(header->rcode==NOERROR && (count=ntohs(header->ancount)))
|
||||||
(count=ntohs(((HEADER *)answer)->ancount)))
|
|
||||||
{
|
{
|
||||||
int i,rc;
|
int i,rc;
|
||||||
|
|
||||||
@ -234,7 +234,14 @@ main(int argc,char *argv[])
|
|||||||
struct srventry *srv;
|
struct srventry *srv;
|
||||||
int rc,i;
|
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);
|
printf("Count=%d\n\n",rc);
|
||||||
for(i=0;i<rc;i++)
|
for(i=0;i<rc;i++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user