aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/gen/jrand48.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/jrand48.c')
-rw-r--r--lib/libc/gen/jrand48.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/gen/jrand48.c b/lib/libc/gen/jrand48.c
index 0a9f780a9e5c..93442439d49e 100644
--- a/lib/libc/gen/jrand48.c
+++ b/lib/libc/gen/jrand48.c
@@ -11,14 +11,13 @@
* to anyone/anything when using this software.
*/
-#include <stdint.h>
-
#include "rand48.h"
long
jrand48(unsigned short xseed[3])
{
+ uint48 tmp;
- _dorand48(xseed);
- return ((int32_t)(((uint32_t)xseed[2] << 16) | (uint32_t)xseed[1]));
+ DORAND48(tmp, xseed);
+ return ((int)((tmp >> 16) & 0xffffffff));
}