mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-01-30 15:02:18 +01:00
20029: fix randomness of mathfunc rand48(seed)
This commit is contained in:
parent
a9c6ca4ede
commit
ed76bafc5e
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2004-06-08 Peter Stephenson <pws@pwstephenson.fsnet.co.uk>
|
||||||
|
|
||||||
|
* 20029: Src/Modules/mathfunc.c: rand48(seed) stopped being
|
||||||
|
random after the second call.
|
||||||
|
|
||||||
2004-06-08 Peter Stephenson <pws@csr.com>
|
2004-06-08 Peter Stephenson <pws@csr.com>
|
||||||
|
|
||||||
* Philippe Troin: 20026: INSTALL: nit-pick.
|
* Philippe Troin: 20026: INSTALL: nit-pick.
|
||||||
|
|
|
@ -500,7 +500,7 @@ math_string(UNUSED(char *name), char *arg, int id)
|
||||||
* to each unsigned short.
|
* to each unsigned short.
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < 3 && !do_init; i++) {
|
for (i = 0; i < 3 && !do_init; i++) {
|
||||||
unsigned short *seedptr = seedbuf + i;
|
unsigned short *seedptr = seedbufptr + i;
|
||||||
*seedptr = 0;
|
*seedptr = 0;
|
||||||
for (j = 0; j < 4; j++) {
|
for (j = 0; j < 4; j++) {
|
||||||
if (*seedstr >= '0' && *seedstr <= '9')
|
if (*seedstr >= '0' && *seedstr <= '9')
|
||||||
|
|
Loading…
Reference in a new issue