diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-02 11:54:52 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-01-02 11:54:52 +0000 |
commit | 432a992aafc6756a02963629f49ff26b1489ddc8 (patch) | |
tree | 67e9228dd4fce54a28eb48c4cbc167c9aa1a261f /lib/securerandom.rb | |
parent | 519187a259e4ddc27a4273fed241cf600a844f14 (diff) | |
download | ruby-432a992aafc6756a02963629f49ff26b1489ddc8.tar.gz |
* 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
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 04e8bc205e..eede2fef04 100644 --- a/lib/securerandom.rb +++ b/lib/securerandom.rb @@ -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 |