diff options
Diffstat (limited to 'random.c')
-rw-r--r-- | random.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -332,9 +332,12 @@ rb_f_srand(int argc, VALUE *argv, VALUE obj) VALUE seed, old; rb_secure(4); - if (rb_scan_args(argc, argv, "01", &seed) == 0) { + if (argc == 0) { seed = random_seed(); } + else { + rb_scan_args(argc, argv, "01", &seed); + } old = rand_init(seed); return old; |