Changed bzero to memset.

Changed bcmp to memcmp.
Added #include <string.h> to bring prototypes into scope.
This commit is contained in:
jtc 1995-04-14 19:48:20 +00:00
parent 4af41fe4b3
commit 3c565bbea8
10 changed files with 43 additions and 32 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bindresvport.c,v 1.3 1995/02/25 03:01:37 cgd Exp $ */
/* $NetBSD: bindresvport.c,v 1.4 1995/04/14 19:48:20 jtc Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -32,13 +32,14 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)bindresvport.c 1.8 88/02/08 SMI";*/
/*static char *sccsid = "from: @(#)bindresvport.c 2.2 88/07/29 4.0 RPCSRC";*/
static char *rcsid = "$NetBSD: bindresvport.c,v 1.3 1995/02/25 03:01:37 cgd Exp $";
static char *rcsid = "$NetBSD: bindresvport.c,v 1.4 1995/04/14 19:48:20 jtc Exp $";
#endif
/*
* Copyright (c) 1987 by Sun Microsystems, Inc.
*/
#include <string.h>
#include <sys/types.h>
#include <sys/errno.h>
#include <sys/socket.h>
@ -62,7 +63,7 @@ bindresvport(sd, sin)
if (sin == (struct sockaddr_in *)0) {
sin = &myaddr;
bzero(sin, sizeof (*sin));
memset(sin, 0, sizeof (*sin));
sin->sin_family = AF_INET;
} else if (sin->sin_family != AF_INET) {
errno = EPFNOSUPPORT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: clnt_generic.c,v 1.4 1995/02/25 03:01:38 cgd Exp $ */
/* $NetBSD: clnt_generic.c,v 1.5 1995/04/14 19:48:23 jtc Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -32,12 +32,13 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)clnt_generic.c 1.4 87/08/11 (C) 1987 SMI";*/
/*static char *sccsid = "from: @(#)clnt_generic.c 2.2 88/08/01 4.0 RPCSRC";*/
static char *rcsid = "$NetBSD: clnt_generic.c,v 1.4 1995/02/25 03:01:38 cgd Exp $";
static char *rcsid = "$NetBSD: clnt_generic.c,v 1.5 1995/04/14 19:48:23 jtc Exp $";
#endif
/*
* Copyright (C) 1987, Sun Microsystems, Inc.
*/
#include <string.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <sys/errno.h>
@ -75,7 +76,7 @@ clnt_create(hostname, prog, vers, proto)
rpc_createerr.cf_error.re_errno = EAFNOSUPPORT;
return (NULL);
}
bzero((char *)&sin, sizeof sin);
memset(&sin, 0, sizeof(sin));
sin.sin_family = h->h_addrtype;
sin.sin_port = 0;
bcopy(h->h_addr, (char*)&sin.sin_addr, h->h_length);

View File

@ -1,4 +1,4 @@
/* $NetBSD: clnt_simple.c,v 1.3 1995/02/25 03:01:41 cgd Exp $ */
/* $NetBSD: clnt_simple.c,v 1.4 1995/04/14 19:48:24 jtc Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -32,7 +32,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)clnt_simple.c 1.35 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)clnt_simple.c 2.2 88/08/01 4.0 RPCSRC";*/
static char *rcsid = "$NetBSD: clnt_simple.c,v 1.3 1995/02/25 03:01:41 cgd Exp $";
static char *rcsid = "$NetBSD: clnt_simple.c,v 1.4 1995/04/14 19:48:24 jtc Exp $";
#endif
/*
@ -93,7 +93,7 @@ callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out)
return ((int) RPC_UNKNOWNHOST);
timeout.tv_usec = 0;
timeout.tv_sec = 5;
bzero((char *)&server_addr, sizeof server_addr);
memset(&server_addr, 0, sizeof(server_addr));
bcopy(hp->h_addr, (char *)&server_addr.sin_addr, hp->h_length);
server_addr.sin_family = AF_INET;
server_addr.sin_port = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: getrpcport.c,v 1.3 1995/02/25 03:01:46 cgd Exp $ */
/* $NetBSD: getrpcport.c,v 1.4 1995/04/14 19:48:25 jtc Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -32,7 +32,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)getrpcport.c 1.3 87/08/11 SMI";*/
/*static char *sccsid = "from: @(#)getrpcport.c 2.1 88/07/29 4.0 RPCSRC";*/
static char *rcsid = "$NetBSD: getrpcport.c,v 1.3 1995/02/25 03:01:46 cgd Exp $";
static char *rcsid = "$NetBSD: getrpcport.c,v 1.4 1995/04/14 19:48:25 jtc Exp $";
#endif
/*
@ -40,6 +40,7 @@ static char *rcsid = "$NetBSD: getrpcport.c,v 1.3 1995/02/25 03:01:46 cgd Exp $"
*/
#include <stdio.h>
#include <string.h>
#include <rpc/rpc.h>
#include <netdb.h>
#include <sys/socket.h>
@ -52,7 +53,7 @@ getrpcport(host, prognum, versnum, proto)
if ((hp = gethostbyname(host)) == NULL)
return (0);
bzero((char *)&addr, sizeof addr);
memset(&addr, 0, sizeof(addr));
bcopy(hp->h_addr, (char *) &addr.sin_addr, hp->h_length);
addr.sin_family = AF_INET;
addr.sin_port = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_rmt.c,v 1.4 1995/02/25 03:01:52 cgd Exp $ */
/* $NetBSD: pmap_rmt.c,v 1.5 1995/04/14 19:48:26 jtc Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -32,7 +32,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)pmap_rmt.c 1.21 87/08/27 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)pmap_rmt.c 2.2 88/08/01 4.0 RPCSRC";*/
static char *rcsid = "$NetBSD: pmap_rmt.c,v 1.4 1995/02/25 03:01:52 cgd Exp $";
static char *rcsid = "$NetBSD: pmap_rmt.c,v 1.5 1995/04/14 19:48:26 jtc Exp $";
#endif
/*
@ -50,6 +50,7 @@ static char *rcsid = "$NetBSD: pmap_rmt.c,v 1.4 1995/02/25 03:01:52 cgd Exp $";
#include <sys/socket.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
@ -266,7 +267,7 @@ clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult)
FD_ZERO(&mask);
FD_SET(sock, &mask);
nets = getbroadcastnets(addrs, sock, inbuf);
bzero((char *)&baddr, sizeof (baddr));
memset(&baddr, 0, sizeof (baddr));
baddr.sin_family = AF_INET;
baddr.sin_port = htons(PMAPPORT);
baddr.sin_addr.s_addr = htonl(INADDR_ANY);

View File

@ -1,4 +1,4 @@
/* $NetBSD: svc_simple.c,v 1.3 1995/02/25 03:02:00 cgd Exp $ */
/* $NetBSD: svc_simple.c,v 1.4 1995/04/14 19:48:28 jtc Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -32,7 +32,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)svc_simple.c 1.18 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)svc_simple.c 2.2 88/08/01 4.0 RPCSRC";*/
static char *rcsid = "$NetBSD: svc_simple.c,v 1.3 1995/02/25 03:02:00 cgd Exp $";
static char *rcsid = "$NetBSD: svc_simple.c,v 1.4 1995/04/14 19:48:28 jtc Exp $";
#endif
/*
@ -44,6 +44,7 @@ static char *rcsid = "$NetBSD: svc_simple.c,v 1.3 1995/02/25 03:02:00 cgd Exp $"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <netdb.h>
@ -123,7 +124,7 @@ universal(rqstp, transp)
for (pl = proglst; pl != NULL; pl = pl->p_nxt)
if (pl->p_prognum == prog && pl->p_procnum == proc) {
/* decode arguments into a CLEAN buffer */
bzero(xdrbuf, sizeof(xdrbuf)); /* required ! */
memset(xdrbuf, 0, sizeof(xdrbuf)); /* required ! */
if (!svc_getargs(transp, pl->p_inproc, xdrbuf)) {
svcerr_decode(transp);
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svc_tcp.c,v 1.4 1995/02/25 03:02:01 cgd Exp $ */
/* $NetBSD: svc_tcp.c,v 1.5 1995/04/14 19:48:29 jtc Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -32,7 +32,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)svc_tcp.c 1.21 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)svc_tcp.c 2.2 88/08/01 4.0 RPCSRC";*/
static char *rcsid = "$NetBSD: svc_tcp.c,v 1.4 1995/02/25 03:02:01 cgd Exp $";
static char *rcsid = "$NetBSD: svc_tcp.c,v 1.5 1995/04/14 19:48:29 jtc Exp $";
#endif
/*
@ -47,6 +47,7 @@ static char *rcsid = "$NetBSD: svc_tcp.c,v 1.4 1995/02/25 03:02:01 cgd Exp $";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <errno.h>
@ -139,7 +140,7 @@ svctcp_create(sock, sendsize, recvsize)
}
madesock = TRUE;
}
bzero((char *)&addr, sizeof (addr));
memset(&addr, 0, sizeof (addr));
addr.sin_family = AF_INET;
if (bindresvport(sock, &addr)) {
addr.sin_port = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: svc_udp.c,v 1.4 1995/02/25 03:02:02 cgd Exp $ */
/* $NetBSD: svc_udp.c,v 1.5 1995/04/14 19:48:30 jtc Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -32,7 +32,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)svc_udp.c 1.24 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)svc_udp.c 2.2 88/07/29 4.0 RPCSRC";*/
static char *rcsid = "$NetBSD: svc_udp.c,v 1.4 1995/02/25 03:02:02 cgd Exp $";
static char *rcsid = "$NetBSD: svc_udp.c,v 1.5 1995/04/14 19:48:30 jtc Exp $";
#endif
/*
@ -45,6 +45,7 @@ static char *rcsid = "$NetBSD: svc_udp.c,v 1.4 1995/02/25 03:02:02 cgd Exp $";
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rpc/rpc.h>
#include <sys/socket.h>
#include <errno.h>
@ -112,7 +113,7 @@ svcudp_bufcreate(sock, sendsz, recvsz)
}
madesock = TRUE;
}
bzero((char *)&addr, sizeof (addr));
memset(&addr, 0, sizeof (addr));
addr.sin_family = AF_INET;
if (bindresvport(sock, &addr)) {
addr.sin_port = 0;
@ -284,7 +285,7 @@ svcudp_destroy(xprt)
(type *) mem_alloc((unsigned) (sizeof(type) * (size)))
#define BZERO(addr, type, size) \
bzero((char *) addr, sizeof(type) * (int) (size))
memset((char *) addr, 0, sizeof(type) * (int) (size))
/*
* An entry in the cache
@ -453,7 +454,7 @@ cache_get(xprt, msg, replyp, replylenp)
register struct svcudp_data *su = su_data(xprt);
register struct udp_cache *uc = (struct udp_cache *) su->su_cache;
# define EQADDR(a1, a2) (bcmp((char*)&a1, (char*)&a2, sizeof(a1)) == 0)
# define EQADDR(a1, a2) (memcmp(&a1, &a2, sizeof(a1)) == 0)
loc = CACHE_LOC(xprt, su->su_xid);
for (ent = uc->uc_entries[loc]; ent != NULL; ent = ent->cache_next) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: xdr_array.c,v 1.2 1995/02/25 03:02:05 cgd Exp $ */
/* $NetBSD: xdr_array.c,v 1.3 1995/04/14 19:48:32 jtc Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -32,7 +32,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)xdr_array.c 1.10 87/08/11 Copyr 1984 Sun Micro";*/
/*static char *sccsid = "from: @(#)xdr_array.c 2.1 88/07/29 4.0 RPCSRC";*/
static char *rcsid = "$NetBSD: xdr_array.c,v 1.2 1995/02/25 03:02:05 cgd Exp $";
static char *rcsid = "$NetBSD: xdr_array.c,v 1.3 1995/04/14 19:48:32 jtc Exp $";
#endif
/*
@ -44,8 +44,11 @@ static char *rcsid = "$NetBSD: xdr_array.c,v 1.2 1995/02/25 03:02:05 cgd Exp $";
* arrays. See xdr.h for more info on the interface to xdr.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
@ -99,7 +102,7 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc)
"xdr_array: out of memory\n");
return (FALSE);
}
bzero(target, nodesize);
memset(target, 0, nodesize);
break;
case XDR_FREE:

View File

@ -1,4 +1,4 @@
/* $NetBSD: xdr_reference.c,v 1.3 1995/02/25 03:02:08 cgd Exp $ */
/* $NetBSD: xdr_reference.c,v 1.4 1995/04/14 19:48:33 jtc Exp $ */
/*
* Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@ -32,7 +32,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)xdr_reference.c 1.11 87/08/11 SMI";*/
/*static char *sccsid = "from: @(#)xdr_reference.c 2.1 88/07/29 4.0 RPCSRC";*/
static char *rcsid = "$NetBSD: xdr_reference.c,v 1.3 1995/02/25 03:02:08 cgd Exp $";
static char *rcsid = "$NetBSD: xdr_reference.c,v 1.4 1995/04/14 19:48:33 jtc Exp $";
#endif
/*
@ -46,6 +46,7 @@ static char *rcsid = "$NetBSD: xdr_reference.c,v 1.3 1995/02/25 03:02:08 cgd Exp
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
@ -82,7 +83,7 @@ xdr_reference(xdrs, pp, size, proc)
"xdr_reference: out of memory\n");
return (FALSE);
}
bzero(loc, (int)size);
memset(loc, 0, (int)size);
break;
}