[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

**To**:**Guilherme Janczak <guilherme.janczak%yandex.com@localhost>****Subject**:**Re: lib/56824 (modulo by 0 in arc4random_uniform())****From**:**Joerg Sonnenberger <joerg%bec.de@localhost>**- Date: Mon, 9 May 2022 01:05:12 +0200

Am Sun, May 08, 2022 at 10:58:46PM +0000 schrieb Guilherme Janczak: > On Sun, May 08, 2022 at 10:40:10PM +0000, joerg%NetBSD.org@localhost wrote: > > Synopsis: modulo by 0 in arc4random_uniform() > > > > State-Changed-From-To: open->closed > > State-Changed-By: joerg%NetBSD.org@localhost > > State-Changed-When: Sun, 08 May 2022 22:40:10 +0000 > > State-Changed-Why: > > This is not a bug. You are asking for a number in the range [0, 0), which is empty. > > A domain error is the correct result. > > > That's true, but arc4random_uniform comes from OpenBSD and their version > returns 0 in this case. Wouldn't it make more sense to imitate OpenBSD > behavior than to introduce different behavior? It doesn't make the answer less nonsensical. Joerg

**References**:**Re: lib/56824 (modulo by 0 in arc4random_uniform())***From:*joerg

**Re: lib/56824 (modulo by 0 in arc4random_uniform())***From:*Guilherme Janczak

- Prev by Date:
**Re: lib/56824 (modulo by 0 in arc4random_uniform())** - Next by Date:
**Re: lib/56824 (modulo by 0 in arc4random_uniform())** - Previous by Thread:
**Re: lib/56824 (modulo by 0 in arc4random_uniform())** - Next by Thread:
**Re: lib/56824 (modulo by 0 in arc4random_uniform())** - Indexes: