Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Random#bytes should return binary string.

  • Loading branch information...
commit 475e6cfd07c305645668c1a46e66b362ad07b49e 1 parent 1351eac
@Watson1978 Watson1978 authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  random.c
View
2  random.c
@@ -572,7 +572,7 @@ random_bytes(VALUE obj, SEL sel, VALUE len)
{
long n = NUM2LONG(rb_to_int(len));
if (n <= 0) {
- return rb_str_new2("");
+ return rb_bstr_new();
}
rb_random_t *rnd = get_rnd(obj);
UInt8 *ptr = (UInt8 *)malloc(n);
Please sign in to comment.
Something went wrong with that request. Please try again.