summaryrefslogtreecommitdiff
path: root/lib/securerandom.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/securerandom.rb')
-rw-r--r--lib/securerandom.rb2
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)