Skip to content

Commit

Permalink
* lib/securerandom.rb (random_bytes): use IO#read instead of
Browse files Browse the repository at this point in the history
  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
  • Loading branch information
akr committed Jan 2, 2012
1 parent 519187a commit 432a992
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Mon Jan 2 20:53:36 2012 Tanaka Akira <akr@fsij.org>

* lib/securerandom.rb (random_bytes): use IO#read instead of
IO#readpartial to make the intent more clear.

Mon Jan 2 15:26:39 2012 Kazuki Tsujimoto <kazuki@callcc.net>

* test/ruby/test_object.rb (test_send_with_block): add a normal case.
Expand Down
2 changes: 1 addition & 1 deletion lib/securerandom.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def self.random_bytes(n=nil)
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
Expand Down

0 comments on commit 432a992

Please sign in to comment.