diff options
| author | Peter Stephenson <pws@users.sourceforge.net> | 2006-08-04 09:18:53 +0000 |
|---|---|---|
| committer | Peter Stephenson <pws@users.sourceforge.net> | 2006-08-04 09:18:53 +0000 |
| commit | 504ea49e4c8692cb25dc20b6aea85b32bbc08a37 (patch) | |
| tree | f702267598019d2500b6b7a20080ac46f225c325 /Src/Modules/mathfunc.c | |
| parent | rationalise mb<->wc conversions to use restartable form (diff) | |
| download | zsh-504ea49e4c8692cb25dc20b6aea85b32bbc08a37.tar zsh-504ea49e4c8692cb25dc20b6aea85b32bbc08a37.tar.gz zsh-504ea49e4c8692cb25dc20b6aea85b32bbc08a37.tar.bz2 zsh-504ea49e4c8692cb25dc20b6aea85b32bbc08a37.tar.lz zsh-504ea49e4c8692cb25dc20b6aea85b32bbc08a37.tar.xz zsh-504ea49e4c8692cb25dc20b6aea85b32bbc08a37.tar.zst zsh-504ea49e4c8692cb25dc20b6aea85b32bbc08a37.zip | |
22583: erand48() needs initialisation on Cygwin.
Diffstat (limited to 'Src/Modules/mathfunc.c')
| -rw-r--r-- | Src/Modules/mathfunc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Src/Modules/mathfunc.c b/Src/Modules/mathfunc.c index 4d58745e8..f6d437ff9 100644 --- a/Src/Modules/mathfunc.c +++ b/Src/Modules/mathfunc.c @@ -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); |
