amd64/81279: /usr/games/random returns every line

Adriaan de Groot groot at kde.org
Thu May 19 14:30:07 PDT 2005


The following reply was made to PR amd64/81279; it has been noted by GNATS.

From: Adriaan de Groot <groot at kde.org>
To: bug-followup at freebsd.org, vivek at 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


More information about the freebsd-amd64 mailing list