]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(__jrand48_r): Set also upper half of result.
authorUlrich Drepper <drepper@redhat.com>
Fri, 28 Aug 1998 12:07:12 +0000 (12:07 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 28 Aug 1998 12:07:12 +0000 (12:07 +0000)
stdlib/jrand48_r.c

index 648604d4f54c924c0d9960d88edc5855dbd2d5db..b82e51d8925932379cc753d649db094380126f68 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
 
@@ -31,7 +31,7 @@ jrand48_r (xsubi, buffer, result)
 
   /* Store the result.  */
   if (sizeof (unsigned short int) == 2)
-    *result = (xsubi[2] & 0x7fff) | xsubi[1];
+    *result = ((xsubi[2] & 0x7fff) << 16) | xsubi[1];
   else
     *result = xsubi[2] & 0x7fffffffl;