(void) strcpy(one, "");
equal(one, "", 7); /* Boundary condition. */
+ /* stpncpy. */
+ it = "stpncpy";
+
+ memset(one, 'x', sizeof(one));
+ check(stpncpy(one, "abc", 2) == one + 2, 1);
+ check(stpncpy(one, "abc", 3) == one + 3, 2);
+ check(stpncpy(one, "abc", 4) == one + 3, 3);
+ check(one[3] == '\0' && one[4] == 'x', 4);
+ check(stpncpy(one, "abcd", 5) == one + 4, 5);
+ check(one[4] == '\0' && one[5] == 'x', 6);
+ check(stpncpy(one, "abcd", 6) == one + 4, 7);
+ check(one[4] == '\0' && one[5] == '\0' && one[6] == 'x', 8);
+
/* strcat. */
it = "strcat";
(void) strcpy(one, "ijk");
all: # Make this the default target; it will be defined in Rules.
+# Sun's code is not too clean.
+override +gccwarn := -w
+
include ../Makeconfig
-ifeq (no,$(cross-compile))
+ifeq (no,$(cross-compiling))
# We can only build this library if we can run the rpcgen we build.
extra-libs := librpcsvc
extra-libs-others := librpcsvc # Make it in `others' pass, not `lib' pass.
omit-deps = $(librpcsvc-routines)
endif
-# Sun's code is not too clean.
-override +gccwarn := -w
-
include ../Rules
$(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) $(common-objpfx)libc.a
* may copy or modify Sun RPC without charge, but are not authorized
* to license or distribute it to anyone else except as part of a product or
* program developed by the user.
- *
+ *
* SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
* WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
- *
+ *
* Sun RPC is provided with no support and without any obligation on the
* part of Sun Microsystems, Inc. to assist in its use, correction,
* modification or enhancement.
- *
+ *
* SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
* INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
* OR ANY PART THEREOF.
- *
+ *
* In no event will Sun Microsystems, Inc. be liable for any lost revenue
* or profits or other special, indirect and consequential damages, even if
* Sun has been advised of the possibility of such damages.
- *
+ *
* Sun Microsystems, Inc.
* 2550 Garcia Avenue
* Mountain View, California 94043
/* * * * * * * * * * * * * * XDR Authentication * * * * * * * * * * * */
-struct opaque_auth _null_auth;
-
/*
* XDR an opaque authentication struct
* (see auth.h)
/*
* XDR the MSG_ACCEPTED part of a reply message union
*/
-bool_t
+bool_t
xdr_accepted_reply(xdrs, ar)
- register XDR *xdrs;
+ register XDR *xdrs;
register struct accepted_reply *ar;
{
/*
* XDR the MSG_DENIED part of a reply message union
*/
-bool_t
+bool_t
xdr_rejected_reply(xdrs, rr)
register XDR *xdrs;
register struct rejected_reply *rr;
register struct rpc_msg *rmsg;
{
if (
- xdr_u_long(xdrs, &(rmsg->rm_xid)) &&
+ xdr_u_long(xdrs, &(rmsg->rm_xid)) &&
xdr_enum(xdrs, (enum_t *)&(rmsg->rm_direction)) &&
(rmsg->rm_direction == REPLY) )
return (xdr_union(xdrs, (enum_t *)&(rmsg->rm_reply.rp_stat),
error->re_lb.s2 = (long)acpt_stat;
}
-static void
+static void
rejected(rjct_stat, error)
register enum reject_stat rjct_stat;
register struct rpc_err *error;