diff options
author | Ulrich Drepper <drepper@redhat.com> | 1997-04-21 14:26:11 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1997-04-21 14:26:11 +0000 |
commit | 534645556966afde3a1d59e11198b9b753605889 (patch) | |
tree | 6b903857312c32ae603e2c05ae46dd8c2ed0b450 /stdlib | |
parent | 8e619d6a10ef7ad7662c8e2586437b27ea3042aa (diff) | |
download | glibc-534645556966afde3a1d59e11198b9b753605889.tar.gz glibc-534645556966afde3a1d59e11198b9b753605889.tar.xz glibc-534645556966afde3a1d59e11198b9b753605889.zip |
Also reset `a' and `c' to default values.
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/srand48_r.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/stdlib/srand48_r.c b/stdlib/srand48_r.c index 80cc7eb6c8..042c669950 100644 --- a/stdlib/srand48_r.c +++ b/stdlib/srand48_r.c @@ -22,22 +22,32 @@ int srand48_r (seedval, buffer) - long seedval; + long int seedval; struct drand48_data *buffer; { /* The standards say we only have 32 bits. */ - if (sizeof (long) > 4) + if (sizeof (long int) > 4) seedval &= 0xffffffffl; -#if (USHRT_MAX == 0xffffU) +#if USHRT_MAX == 0xffffU buffer->X[2] = seedval >> 16; buffer->X[1] = seedval & 0xffffl; buffer->X[0] = 0x330e; + + buffer->a[2] = 0x5; + buffer->a[1] = 0xdeec; + buffer->a[0] = 0xe66d; #else buffer->X[2] = seedval; buffer->X[1] = 0x330e0000UL; buffer->X[0] = 0; + + buffer->a[2] = 0x5deecUL; + buffer->a[1] = 0xe66d0000UL; + buffer->a[0] = 0; #endif + buffer->c = 0xb; + buffer->init = 1; return 0; } |