1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-29 12:03:03 +00:00

Use arc4random_uniform(3)

This commit is contained in:
Andrey A. Chernov 2008-08-07 22:22:41 +00:00
parent 921651bdd3
commit 68910e7a67
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181397

View File

@ -411,7 +411,7 @@ mkfifotemp(char *template)
* them with random characters until there are no more 'X'.
*/
while (ptr >= template && *ptr == 'X') {
uint32_t rand_num = arc4random() % (sizeof(padchar) - 1);
uint32_t rand_num = arc4random_uniform(sizeof(padchar) - 1);
*ptr-- = padchar[rand_num];
}
start = ptr + 1;