diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-07 11:15:28 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-05-07 11:15:28 +0000 |
commit | e76660caad5cda23abd65b7431f2df635280a741 (patch) | |
tree | e9b692400a92c15e58c530b51b737aefccda48f1 /lib/securerandom.rb | |
parent | 34a8bfa971e19985224b42af087778a4c14e0e6e (diff) |
* lib/securerandom.rb (random_bytes): call to_int method for the
argument at first.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/securerandom.rb')
-rw-r--r-- | lib/securerandom.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/securerandom.rb b/lib/securerandom.rb index a12e92fc7a..f550ce6615 100644 --- a/lib/securerandom.rb +++ b/lib/securerandom.rb @@ -54,7 +54,7 @@ module SecureRandom # If secure random number generator is not available, # NotImplementedError is raised. def self.random_bytes(n=nil) - n ||= 16 + n = n ? n.to_int : 16 if defined? OpenSSL::Random @pid = 0 if !defined?(@pid) |