use more randomness
authorfpunktk <git@fpunktk.de>
Sat, 30 Dec 2017 11:22:37 +0000 (12:22 +0100)
committerfpunktk <git@fpunktk.de>
Sat, 30 Dec 2017 11:22:37 +0000 (12:22 +0100)
anondcim

index f8ca87c241dc8e522aa630205add4fa134ab5122..bbaae33fddd52097102b4364832ba3fe548299bf 100755 (executable)
--- a/anondcim
+++ b/anondcim
@@ -30,7 +30,7 @@ die() {
 rand() {
     # random number between 0 and $1 - 1
     # read from urandom, sh interpretes numbers with leading 0 wrong, so prepend $1 which doesn't change the result
-    echo $(( $1$(tr -dc "0-9" < /dev/urandom | head -c $((${#1} + 1))) % $1 ))
+    echo $(( $1$(tr -dc "0-9" < /dev/urandom | head -c $((${#1} + 2))) % $1 ))
 }
 
 [ $# -gt 0 ] || die "Usage: $0 [-p image_prefix] [-s destination_size (absolute or percentage)] [-d destination_directory] imagefile(s)"