Index: include/rpc/xdr.h
===================================================================
RCS file: /home/ncvs/src/include/rpc/xdr.h,v
retrieving revision 1.14
diff -u -r1.14 xdr.h
--- include/rpc/xdr.h	29 Dec 1999 05:00:44 -0000	1.14
+++ include/rpc/xdr.h	20 Mar 2003 00:33:27 -0000
@@ -118,7 +118,7 @@
 	caddr_t 	x_public;	/* users' data */
 	caddr_t		x_private;	/* pointer to private data */
 	caddr_t 	x_base;		/* private used for position info */
-	int		x_handy;	/* extra private word */
+	u_int		x_handy;	/* extra private word */
 } XDR;
 
 /*
Index: lib/libc/xdr/xdr_mem.c
===================================================================
RCS file: /home/ncvs/src/lib/libc/xdr/xdr_mem.c,v
retrieving revision 1.8
diff -u -r1.8 xdr_mem.c
--- lib/libc/xdr/xdr_mem.c	28 Aug 1999 00:02:56 -0000	1.8
+++ lib/libc/xdr/xdr_mem.c	20 Mar 2003 00:33:27 -0000
@@ -115,8 +115,9 @@
 	long *lp;
 {
 
-	if ((xdrs->x_handy -= sizeof(int32_t)) < 0)
+	if (xdrs->x_handy < sizeof(int32_t))
 		return (FALSE);
+	xdrs->x_handy -= sizeof(int32_t);
 	*lp = ntohl(*(int32_t *)(xdrs->x_private));
 	xdrs->x_private += sizeof(int32_t);
 	return (TRUE);
@@ -128,8 +129,9 @@
 	long *lp;
 {
 
-	if ((xdrs->x_handy -= sizeof(int32_t)) < 0)
+	if (xdrs->x_handy < sizeof(int32_t))
 		return (FALSE);
+	xdrs->x_handy -= sizeof(int32_t);
 	*(int32_t *)xdrs->x_private = htonl(*lp);
 	xdrs->x_private += sizeof(int32_t);
 	return (TRUE);
@@ -142,8 +144,9 @@
 {
 	int32_t l;
 
-	if ((xdrs->x_handy -= sizeof(int32_t)) < 0)
+	if (xdrs->x_handy < sizeof(int32_t))
 		return (FALSE);
+	xdrs->x_handy -= sizeof(int32_t);
 	memcpy(&l, xdrs->x_private, sizeof(int32_t));
 	*lp = ntohl(l);
 	xdrs->x_private += sizeof(int32_t);
@@ -157,8 +160,9 @@
 {
 	int32_t l;
 
-	if ((xdrs->x_handy -= sizeof(int32_t)) < 0)
+	if (xdrs->x_handy < sizeof(int32_t))
 		return (FALSE);
+	xdrs->x_handy -= sizeof(int32_t);
 	l = htonl(*lp);
 	memcpy(xdrs->x_private, &l, sizeof(int32_t));
 	xdrs->x_private += sizeof(int32_t);
@@ -172,8 +176,9 @@
 	register u_int len;
 {
 
-	if ((xdrs->x_handy -= len) < 0)
+	if (xdrs->x_handy < len)
 		return (FALSE);
+	xdrs->x_handy -= len;
 	memcpy(addr, xdrs->x_private, len);
 	xdrs->x_private += len;
 	return (TRUE);
@@ -186,8 +191,9 @@
 	register u_int len;
 {
 
-	if ((xdrs->x_handy -= len) < 0)
+	if (xdrs->x_handy < len)
 		return (FALSE);
+	xdrs->x_handy -= len;
 	memcpy(xdrs->x_private, addr, len);
 	xdrs->x_private += len;
 	return (TRUE);
@@ -210,10 +216,10 @@
 	register caddr_t newaddr = xdrs->x_base + pos;
 	register caddr_t lastaddr = xdrs->x_private + xdrs->x_handy;
 
-	if ((long)newaddr > (long)lastaddr)
+	if (newaddr > lastaddr)
 		return (FALSE);
 	xdrs->x_private = newaddr;
-	xdrs->x_handy = (long)lastaddr - (long)newaddr;
+	xdrs->x_handy = (u_int)(lastaddr - newaddr); /* XXX sizeof(u_int) <? sizeof(ptrdiff_t) */
 	return (TRUE);
 }
 
