diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-03 18:16:10 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-08-03 18:16:10 +1200 |
commit | 1d7bc34e01e416d84839e01529484b29311aa96d (patch) | |
tree | 16f27417d9d45f1b6e8ee79bd79c3601cc94b048 /bin/rndi | |
parent | Add mentions to rndn(6) manual page (diff) | |
download | dotfiles-1d7bc34e01e416d84839e01529484b29311aa96d.tar.gz dotfiles-1d7bc34e01e416d84839e01529484b29311aa96d.zip |
Actually check for seed presence in rndi(1)
Diffstat (limited to 'bin/rndi')
-rwxr-xr-x | bin/rndi | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -3,7 +3,12 @@ # implementation, if you don't provide a third argument (a seed), you might get # very predictable random numbers based on the current epoch second. BEGIN { - srand(ARGV[3]) + if (ARGV[3]) { + srand(ARGV[3]) + } + else { + srand() + } print int(ARGV[1]+rand()*(ARGV[2]-ARGV[1]+1)) exit } |