diff options
author | Damien Miller <djm@mindrot.org> | 2010-12-03 10:50:26 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2010-12-03 10:50:26 +1100 |
commit | d89745b9e7e2048c13b0173eadc2d41e23b6a79d (patch) | |
tree | c155f820167a055d9ce2425491aeb91204dfa061 /openbsd-compat/bindresvport.c | |
parent | d925dcd8a5d1a3070061006788352bed93260582 (diff) |
- (djm) [openbsd-compat/bindresvport.c] Use arc4random_uniform(range)
instead of (arc4random() % range)
Diffstat (limited to 'openbsd-compat/bindresvport.c')
-rw-r--r-- | openbsd-compat/bindresvport.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/openbsd-compat/bindresvport.c b/openbsd-compat/bindresvport.c index c0d5bdb5c..c89f21403 100644 --- a/openbsd-compat/bindresvport.c +++ b/openbsd-compat/bindresvport.c | |||
@@ -89,7 +89,7 @@ bindresvport_sa(int sd, struct sockaddr *sa) | |||
89 | 89 | ||
90 | port = ntohs(*portp); | 90 | port = ntohs(*portp); |
91 | if (port == 0) | 91 | if (port == 0) |
92 | port = (arc4random() % NPORTS) + STARTPORT; | 92 | port = arc4random_uniform(NPORTS) + STARTPORT; |
93 | 93 | ||
94 | /* Avoid warning */ | 94 | /* Avoid warning */ |
95 | error = -1; | 95 | error = -1; |