mirror of
https://github.com/openbsd/xenocara.git
synced 2025-12-12 04:09:15 +00:00
fix arc4random_uniform() usage. Noticed by deraadt@
This commit is contained in:
@@ -1013,8 +1013,8 @@ do_ico_window(void *ptr)
|
|||||||
icoX = ((closure->winW - icoW) * (rand() & 0xFF)) >> 8;
|
icoX = ((closure->winW - icoW) * (rand() & 0xFF)) >> 8;
|
||||||
icoY = ((closure->winH - icoH) * (rand() & 0xFF)) >> 8;
|
icoY = ((closure->winH - icoH) * (rand() & 0xFF)) >> 8;
|
||||||
#else
|
#else
|
||||||
icoX = ((closure->winW - icoW) * arc4random_uniform(0xFF)) >> 8;
|
icoX = ((closure->winW - icoW) * arc4random_uniform(0x100)) >> 8;
|
||||||
icoY = ((closure->winH - icoH) * arc4random_uniform(0xFF)) >> 8;
|
icoY = ((closure->winH - icoH) * arc4random_uniform(0x100)) >> 8;
|
||||||
#endif
|
#endif
|
||||||
/* Bounce the box in the window */
|
/* Bounce the box in the window */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user