diff options
author | ache <ache@FreeBSD.org> | 2008-07-22 15:08:50 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2008-07-22 15:08:50 +0000 |
commit | e3afb9ef3c6cd06aed44fca11ad1dd964e273ebc (patch) | |
tree | 63aa9865ae107f4c8152c2284460241ac664a768 /lib | |
parent | 3348213ee84926779b568fe55a7aa11a76585893 (diff) | |
download | FreeBSD-src-e3afb9ef3c6cd06aed44fca11ad1dd964e273ebc.zip FreeBSD-src-e3afb9ef3c6cd06aed44fca11ad1dd964e273ebc.tar.gz |
Use arc4random_uniform(3) since modulo size is not power of 2
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/stdio/mktemp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c index 37bfb02..e8f51d4 100644 --- a/lib/libc/stdio/mktemp.c +++ b/lib/libc/stdio/mktemp.c @@ -125,7 +125,7 @@ _gettemp(path, doopen, domkdir, slen) /* Fill space with random characters */ while (trv >= path && *trv == 'X') { - rand = arc4random() % (sizeof(padchar) - 1); + rand = arc4random_uniform(sizeof(padchar) - 1); *trv-- = padchar[rand]; } start = trv + 1; |