Skip to content
Browse files

Random#bytes should return binary string.

  • Loading branch information...
1 parent 1351eac commit 475e6cfd07c305645668c1a46e66b362ad07b49e @Watson1978 Watson1978 committed Jan 10, 2012
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);

0 comments on commit 475e6cf

Please sign in to comment.
Something went wrong with that request. Please try again.