summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-04-25 22:15:10 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-04-25 22:15:10 (EDT)
commit83b0f0b3a05323dfb906ecf915f979d01bc2f2c3 (patch)
tree22076eab505a16099f67cdb3b055a43f8f1d2a96
parent18252e0c728913402883ce1edfb4dc298935af9d (diff)
srand(): Shift argument and catch null string
-rw-r--r--src/rand.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rand.sh b/src/rand.sh
index 8592dd6..9b2e716 100644
--- a/src/rand.sh
+++ b/src/rand.sh
@@ -23,9 +23,10 @@ rand_x=1
srand()
{
local x="${1}"
+ shift 1
case "${x}" in
- *[!0-9]*)
+ *[!0-9]* | '')
warn "$(get_msg 'rand_bad_x')"
return 1
;;