mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/securerandom.rb (random_bytes): use IO#read instead of
IO#readpartial to make the intent more clear. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
519187a259
commit
432a992aaf
2 changed files with 6 additions and 1 deletions
|
|
@ -78,7 +78,7 @@ module SecureRandom
|
|||
raise Errno::ENOENT
|
||||
end
|
||||
@has_urandom = true
|
||||
ret = f.readpartial(n)
|
||||
ret = f.read(n)
|
||||
if ret.length != n
|
||||
raise NotImplementedError, "Unexpected partial read from random device"
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue