476d9314d6
but ACM formula we use have internal state (and return value) in the [1, 0x7ffffffe] range, so our RAND_MAX (0x7fffffff) is never reached because it is off by one, zero is not reached too. Correct both RAND_MAX and rand(3) return value, shifting last one to the 0 by 1 subtracted, resulting POSIXed [0, 0x7ffffffd(=new RAND_MAX)] range. 2) Add a checks for not overflowing on too big seeds. It may happens on the machines, where sizeof(unsigned int) > 32 bits. Reviewed by: bde [1] MFC after: 2 weeks |
||
---|---|---|
.. | ||
atf | ||
bind | ||
clang | ||
csu | ||
libalias | ||
libarchive | ||
libauditd | ||
libbegemot | ||
libblocksruntime | ||
libbluetooth | ||
libbsm | ||
libbsnmp | ||
libbz2 | ||
libc | ||
libc++ | ||
libcalendar | ||
libcam | ||
libcom_err | ||
libcompat | ||
libcompiler_rt | ||
libcrypt | ||
libcxxrt | ||
libdevinfo | ||
libdevstat | ||
libdwarf | ||
libedit | ||
libefi | ||
libelf | ||
libexpat | ||
libfetch | ||
libgeom | ||
libgpib | ||
libgssapi | ||
libiconv | ||
libiconv_modules | ||
libipsec | ||
libipx | ||
libjail | ||
libkiconv | ||
libkse | ||
libkvm | ||
libldns | ||
liblzma | ||
libmagic | ||
libmandoc | ||
libmd | ||
libmemstat | ||
libmilter | ||
libmp | ||
libnandfs | ||
libnetbsd | ||
libnetgraph | ||
libngatm | ||
libopie | ||
libpam | ||
libpcap | ||
libpmc | ||
libproc | ||
libprocstat | ||
libradius | ||
librpcsec_gss | ||
librpcsvc | ||
librt | ||
librtld_db | ||
libsbuf | ||
libsdp | ||
libsm | ||
libsmb | ||
libsmdb | ||
libsmutil | ||
libstand | ||
libstdbuf | ||
libstdthreads | ||
libtacplus | ||
libtelnet | ||
libthr | ||
libthread_db | ||
libufs | ||
libugidfw | ||
libulog | ||
libusb | ||
libusbhid | ||
libutil | ||
libvgl | ||
libvmmapi | ||
libwrap | ||
liby | ||
libyaml | ||
libypclnt | ||
libz | ||
msun | ||
ncurses | ||
Makefile | ||
Makefile.inc |