fix problem with uninitalized ptr (from PR)

other minor clean up.

PR:		bin/2785
Submitted by:	mpp
This commit is contained in:
John-Mark Gurney 2003-06-20 04:54:27 +00:00
parent 04a7874315
commit 32d742049e

View File

@ -20,6 +20,7 @@ static const char rcsid[] =
#include <arpa/inet.h>
#include <err.h>
#include <netdb.h>
#include <stdlib.h>
/* #define bp_address_u bp_address */
@ -36,7 +37,7 @@ static void usage __P((void));
int printgetfile __P((bp_getfile_res *));
int printwhoami __P((bp_whoami_res *));
int
bool_t
eachres_whoami(resultp, raddr)
bp_whoami_res *resultp;
struct sockaddr_in *raddr;
@ -50,6 +51,7 @@ struct sockaddr_in *raddr;
return(0);
}
bool_t
eachres_getfile(resultp, raddr)
bp_getfile_res *resultp;
struct sockaddr_in *raddr;
@ -95,11 +97,10 @@ char **argv;
if ( ! broadcast ) {
clnt = clnt_create(server,BOOTPARAMPROG, BOOTPARAMVERS, "udp");
if ( clnt == NULL )
errx(1, "could not contact bootparam server on host %s", server);
}
if ( clnt == NULL )
errx(1, "could not contact bootparam server on host %s", server);
switch (argc) {
case 3:
whoami_arg.client_address.address_type = IP_ADDR_TYPE;
@ -118,8 +119,10 @@ char **argv;
} else {
clnt_stat=clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS,
BOOTPARAMPROC_WHOAMI,
(xdrproc_t)xdr_bp_whoami_arg, (char *)&whoami_arg,
xdr_bp_whoami_res, (char *)&stat_whoami_res,
(xdrproc_t)xdr_bp_whoami_arg,
(char *)&whoami_arg,
(xdrproc_t)xdr_bp_whoami_res,
(char *)&stat_whoami_res,
(resultproc_t)eachres_whoami);
exit(0);
}
@ -139,8 +142,10 @@ char **argv;
} else {
clnt_stat=clnt_broadcast(BOOTPARAMPROG, BOOTPARAMVERS,
BOOTPARAMPROC_GETFILE,
xdr_bp_getfile_arg, (char *)&getfile_arg,
xdr_bp_getfile_res, (char *)&stat_getfile_res,
(xdrproc_t)xdr_bp_getfile_arg,
(char *)&getfile_arg,
(xdrproc_t)xdr_bp_getfile_res,
(char *)&stat_getfile_res,
(resultproc_t)eachres_getfile);
exit(0);
}