summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/securerandom.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index 4a97ff8a78..e1799c0c09 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -104,7 +104,7 @@ module SecureRandom
end
end
if @has_win32
- bytes = " " * n
+ bytes = " ".force_encoding("ASCII-8BIT") * n
if @crypt_gen_random.call(@hProv, bytes.size, bytes) == 0
raise SystemCallError, "CryptGenRandom failed: #{lastWin32ErrorMessage}"
end