diff options
Diffstat (limited to 'random.c')
-rw-r--r-- | random.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -580,6 +580,7 @@ random_raw_seed(VALUE self, VALUE size) { long n = NUM2ULONG(size); VALUE buf = rb_str_new(0, n); + if (n == 0) return buf; if (fill_random_bytes(RSTRING_PTR(buf), n)) return Qnil; return buf; } |