about summary refs log tree commit diff
path: root/sunrpc/xdr_mem.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
committerUlrich Drepper <drepper@redhat.com>2004-12-22 20:10:10 +0000
commita334319f6530564d22e775935d9c91663623a1b4 (patch)
treeb5877475619e4c938e98757d518bb1e9cbead751 /sunrpc/xdr_mem.c
parent0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff)
downloadglibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz
glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz
glibc-a334319f6530564d22e775935d9c91663623a1b4.zip
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'sunrpc/xdr_mem.c')
-rw-r--r--sunrpc/xdr_mem.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sunrpc/xdr_mem.c b/sunrpc/xdr_mem.c
index 7b1261bbae..e3167de040 100644
--- a/sunrpc/xdr_mem.c
+++ b/sunrpc/xdr_mem.c
@@ -177,15 +177,13 @@ xdrmem_setpos (xdrs, pos)
 {
   caddr_t newaddr = xdrs->x_base + pos;
   caddr_t lastaddr = xdrs->x_private + xdrs->x_handy;
-  size_t handy = lastaddr - newaddr;
 
-  if (newaddr > lastaddr
-      || newaddr < xdrs->x_base
-      || handy != (u_int) handy)
+  if ((long) newaddr > (long) lastaddr
+      || (UINT_MAX < LONG_MAX
+	  && (long) UINT_MAX < (long) lastaddr - (long) newaddr))
     return FALSE;
-
   xdrs->x_private = newaddr;
-  xdrs->x_handy = (u_int) handy;
+  xdrs->x_handy = (long) lastaddr - (long) newaddr;
   return TRUE;
 }