Skip to content
This repository
Browse code

Random#bytes should return binary string.

  • Loading branch information...
commit 475e6cfd07c305645668c1a46e66b362ad07b49e 1 parent 1351eac
Watson authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  random.c
2  random.c
@@ -572,7 +572,7 @@ random_bytes(VALUE obj, SEL sel, VALUE len)
572 572
 {
573 573
     long n = NUM2LONG(rb_to_int(len));
574 574
     if (n <= 0) {
575  
-	return rb_str_new2("");
  575
+	return rb_bstr_new();
576 576
     } 
577 577
     rb_random_t *rnd = get_rnd(obj);
578 578
     UInt8 *ptr = (UInt8 *)malloc(n);

0 notes on commit 475e6cf

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