Date: Thu, 19 May 2005 21:30:07 GMT From: Adriaan de Groot <groot@kde.org> To: freebsd-amd64@FreeBSD.org Subject: Re: amd64/81279: /usr/games/random returns every line Message-ID: <200505192130.j4JLU7wg078285@freefall.freebsd.org>
index | next in thread | raw e-mail
The following reply was made to PR amd64/81279; it has been noted by GNATS.
From: Adriaan de Groot <groot@kde.org>
To: bug-followup@freebsd.org, vivek@khera.org
Cc:
Subject: Re: amd64/81279: /usr/games/random returns every line
Date: Thu, 19 May 2005 23:26:08 +0200
Problem is lines like
selected = (int)(denom * random() / LONG_MAX) == 0;
which cause the overflow. Replacing LONG_MAX with INT_MAX here fixes the bug.
(The same replacement should probably be done in the other two places that
LONG_MAX occurs, since the -e flag is similarly broken.)
--
These are your friends - Adem
GPG: FEA2 A3FE Adriaan de Groot
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505192130.j4JLU7wg078285>
