mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/openssl/ossl_bn.c (ossl_bn_s_rand, ossl_bn_s_pseudo_rand):
Int should be enough here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2745d527b3
commit
cd5eb03b58
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri May 30 03:12:18 2008 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
|
* ext/openssl/ossl_bn.c (ossl_bn_s_rand, ossl_bn_s_pseudo_rand):
|
||||||
|
Int should be enough here.
|
||||||
|
|
||||||
Fri May 30 02:35:00 2008 Akinori MUSHA <knu@iDaemons.org>
|
Fri May 30 02:35:00 2008 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* ext/openssl/ossl_bn.c (ossl_bn_s_rand, ossl_bn_s_pseudo_rand),
|
* ext/openssl/ossl_bn.c (ossl_bn_s_rand, ossl_bn_s_pseudo_rand),
|
||||||
|
|
|
@ -96,7 +96,7 @@ static VALUE
|
||||||
ossl_rand_bytes(VALUE self, VALUE len)
|
ossl_rand_bytes(VALUE self, VALUE len)
|
||||||
{
|
{
|
||||||
VALUE str;
|
VALUE str;
|
||||||
long n = NUM2INT(len);
|
int n = NUM2INT(len);
|
||||||
|
|
||||||
str = rb_str_new(0, n);
|
str = rb_str_new(0, n);
|
||||||
if (!RAND_bytes(RSTRING_PTR(str), n)) {
|
if (!RAND_bytes(RSTRING_PTR(str), n)) {
|
||||||
|
@ -115,7 +115,7 @@ static VALUE
|
||||||
ossl_rand_pseudo_bytes(VALUE self, VALUE len)
|
ossl_rand_pseudo_bytes(VALUE self, VALUE len)
|
||||||
{
|
{
|
||||||
VALUE str;
|
VALUE str;
|
||||||
long n = NUM2INT(len);
|
int n = NUM2INT(len);
|
||||||
|
|
||||||
str = rb_str_new(0, n);
|
str = rb_str_new(0, n);
|
||||||
if (!RAND_pseudo_bytes(RSTRING_PTR(str), n)) {
|
if (!RAND_pseudo_bytes(RSTRING_PTR(str), n)) {
|
||||||
|
|
Loading…
Reference in a new issue