mirror of
https://github.com/fluencelabs/musl
synced 2025-04-25 07:12:15 +00:00
fix mrand48/jrand48 return value on 64-bit archs
POSIX specifies the result to have signed 32-bit range. on 32-bit archs, the implicit conversion to long achieved the desired range already, but when long is 64-bit, a cast is needed. patch by Ed Schouten.
This commit is contained in:
parent
bfcf5735d0
commit
adfe682eb0
@ -6,7 +6,7 @@ extern unsigned short __seed48[7];
|
||||
|
||||
long jrand48(unsigned short s[3])
|
||||
{
|
||||
return __rand48_step(s, __seed48+3) >> 16;
|
||||
return (int32_t)(__rand48_step(s, __seed48+3) >> 16);
|
||||
}
|
||||
|
||||
long mrand48(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user