1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:47:34 +00:00

Userland: Migrate from arc4random_uniform() to get_random_uniform()

This commit is contained in:
Jean-Baptiste Boric 2021-05-14 17:17:26 +02:00 committed by Andreas Kling
parent 069bf988ed
commit 5a0468c21f
5 changed files with 11 additions and 6 deletions

View file

@ -6,6 +6,7 @@
*/
#include "DNSName.h"
#include <AK/Random.h>
#include <AK/Vector.h>
#include <ctype.h>
@ -64,7 +65,7 @@ void DNSName::randomize_case()
for (char c : m_name) {
// Randomize the 0x20 bit in every ASCII character.
if (isalpha(c)) {
if (arc4random_uniform(2))
if (get_random_uniform(2))
c |= 0x20;
else
c &= ~0x20;