1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-17 22:31:12 +01:00

20029: fix randomness of mathfunc rand48(seed)

This commit is contained in:
Peter Stephenson 2004-06-08 21:51:11 +00:00
parent a9c6ca4ede
commit ed76bafc5e
2 changed files with 6 additions and 1 deletions

View file

@ -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>
* Philippe Troin: 20026: INSTALL: nit-pick.

View file

@ -500,7 +500,7 @@ math_string(UNUSED(char *name), char *arg, int id)
* to each unsigned short.
*/
for (i = 0; i < 3 && !do_init; i++) {
unsigned short *seedptr = seedbuf + i;
unsigned short *seedptr = seedbufptr + i;
*seedptr = 0;
for (j = 0; j < 4; j++) {
if (*seedstr >= '0' && *seedstr <= '9')