about summary refs log tree commit diff
path: root/stdlib/jrand48_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/jrand48_r.c')
-rw-r--r--stdlib/jrand48_r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/jrand48_r.c b/stdlib/jrand48_r.c
index 48def5ef35..9df36942f6 100644
--- a/stdlib/jrand48_r.c
+++ b/stdlib/jrand48_r.c
@@ -31,7 +31,7 @@ __jrand48_r (xsubi, buffer, result)
 
   /* Store the result.  */
   if (sizeof (unsigned short int) == 2)
-    *result = (xsubi[2] << 16) | xsubi[1];
+    *result = ((xsubi[2] << 16) | xsubi[1]) & 0xffffffffl;
   else
     *result = xsubi[2] & 0xffffffffl;