1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-29 05:21:00 +01:00

22583: erand48() needs initialisation on Cygwin.

This commit is contained in:
Peter Stephenson 2006-08-04 09:18:53 +00:00
parent 48d6402e65
commit 504ea49e4c
2 changed files with 12 additions and 0 deletions

View file

@ -534,6 +534,13 @@ math_string(UNUSED(char *name), char *arg, int id)
seedbufptr[0] = (unsigned short)rand();
seedbufptr[1] = (unsigned short)rand();
seedbufptr[2] = (unsigned short)rand();
/*
* Some implementations of rand48() need initialization.
* This is likely to be harmless elsewhere, since
* according to the documentation erand48() normally
* doesn't look at the seed set in this way.
*/
(void)seed48(seedbufptr);
}
ret.type = MN_FLOAT;
ret.u.d = erand48(seedbufptr);