about summary refs log tree commit diff
path: root/sunrpc/xdr_intXX_t.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_intXX_t.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_intXX_t.c')
-rw-r--r--sunrpc/xdr_intXX_t.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sunrpc/xdr_intXX_t.c b/sunrpc/xdr_intXX_t.c
index 6c1fca2b23..9d2f92e10d 100644
--- a/sunrpc/xdr_intXX_t.c
+++ b/sunrpc/xdr_intXX_t.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998, 1999, 2000, 2004, 2005 Free Software Foundation, Inc.
+/* Copyright (c) 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
 
@@ -31,7 +31,10 @@
 bool_t
 xdr_int64_t (XDR *xdrs, int64_t *ip)
 {
-  int32_t t1, t2;
+  int32_t t1;
+  /* This must be unsigned, otherwise we get problems with sign
+     extension in the DECODE case.  */
+  uint32_t t2;
 
   switch (xdrs->x_op)
     {
@@ -43,7 +46,7 @@ xdr_int64_t (XDR *xdrs, int64_t *ip)
       if (!XDR_GETINT32(xdrs, &t1) || !XDR_GETINT32(xdrs, &t2))
         return FALSE;
       *ip = ((int64_t) t1) << 32;
-      *ip |= (uint32_t) t2;	/* Avoid sign extension.  */
+      *ip |= t2;
       return TRUE;
     case XDR_FREE:
       return TRUE;