NetBSD Problem Report #841
From gnats Thu Mar 2 20:00:48 1995
Received: from pain.lcs.mit.edu (pain.lcs.mit.edu [128.52.46.239]) by sun-lamp.cs.berkeley.edu (8.6.10/8.6.10) with ESMTP id UAA01997 for <gnats-bugs@sun-lamp.cs.berkeley.edu>; Thu, 2 Mar 1995 20:00:47 -0800
Message-Id: <199503030302.OAA10708@dodo.melb.cpr.itg.telecom.com.au>
Date: Fri, 3 Mar 1995 14:02:17 +1100
From: Luke Mewburn <lukem@dodo.melb.cpr.itg.telecom.com.au>
Reply-To: lukem@dodo.melb.cpr.itg.telecom.com.au
To: gnats-bugs@NetBSD.ORG
Subject: rpcgen-ed files use bzero() not memset()
X-Send-Pr-Version: 3.2
>Number: 841
>Category: bin
>Synopsis: rpcgen-ed files use bzero() not memset()
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 02 20:05:09 +0000 1995
>Closed-Date: Mon Mar 06 04:59:54 +0000 1995
>Last-Modified:
>Originator: Luke Mewburn
>Release: 1.0
>Organization:
" Werj"
>Environment:
System: NetBSD dodo 1.0 NetBSD 1.0 (DODO) #7: Fri Dec 16 17:01:27 EST 1994 simonb@dodo:/slab/0/src/sys/arch/i386/compile/DODO i386
>Description:
I use netbsd rpcgen to generate files for other platforms
without it.
Unfortunately, generated files use bzero() which isn't always
available. Memset() is more available (and (ANSI? POSIX?) standard)
>How-To-Repeat:
Use rpcgen and notice that the resultant files have bzero()s
in them.
>Fix:
apply this patch. it also replaces one internal use of bzero
within rpcgen.
*** usr.bin/rpcgen/rpc_clntout.c.orig Thu Feb 23 21:16:20 1995
--- usr.bin/rpcgen/rpc_clntout.c Thu Feb 23 21:17:23 1995
***************
*** 113,119 ****
}
f_print(fout, "res;\n");
f_print(fout, "\n");
! f_print(fout, "\tbzero((char *)%sres, sizeof(res));\n",
ampr(proc->res_type));
f_print(fout,
"\tif (clnt_call(clnt, %s, xdr_%s, argp, xdr_%s, %sres, TIMEOUT) != RPC_SUCCESS) {\n",
--- 113,119 ----
}
f_print(fout, "res;\n");
f_print(fout, "\n");
! f_print(fout, "\tmemset((char *)%sres, 0, sizeof(res));\n",
ampr(proc->res_type));
f_print(fout,
"\tif (clnt_call(clnt, %s, xdr_%s, argp, xdr_%s, %sres, TIMEOUT) != RPC_SUCCESS) {\n",
*** usr.bin/rpcgen/rpc_svcout.c.orig Thu Feb 23 21:16:31 1995
--- usr.bin/rpcgen/rpc_svcout.c Thu Feb 23 21:17:12 1995
***************
*** 221,227 ****
f_print(fout, "\t\treturn;\n");
f_print(fout, "\t}\n");
! f_print(fout, "\tbzero((char *)&%s, sizeof(%s));\n", ARG, ARG);
printif("getargs", TRANSP, "(caddr_t)&", ARG);
printerr("decode", TRANSP);
f_print(fout, "\t\treturn;\n");
--- 221,228 ----
f_print(fout, "\t\treturn;\n");
f_print(fout, "\t}\n");
! f_print(fout, "\tmemset((char *)&%s, 0, sizeof(%s));\n", ARG,
! ARG);
printif("getargs", TRANSP, "(caddr_t)&", ARG);
printerr("decode", TRANSP);
f_print(fout, "\t\treturn;\n");
*** usr.bin/rpcgen/rpc_util.c.orig Thu Feb 23 21:19:41 1995
--- usr.bin/rpcgen/rpc_util.c Thu Feb 23 21:18:13 1995
***************
*** 63,69 ****
*/
reinitialize()
{
! bzero(curline, MAXLINESIZE);
where = curline;
linenum = 0;
defined = NULL;
--- 63,69 ----
*/
reinitialize()
{
! memset(curline, 0, MAXLINESIZE);
where = curline;
linenum = 0;
defined = NULL;
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: cgd
State-Changed-When: Sun Mar 5 20:59:54 PST 1995
State-Changed-Why:
done.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.49 2026/05/14 01:52:41 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.