Skip to content
Snippets Groups Projects
Commit e0568750 authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

Don't compute with octal numbers

The random number could have leading 0, which meant octal, but then
there could be 8 or 9, which would confuse the follow-up arithmetics.

Fixes #2769.
parent aea039e7
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ trap 'rm -f "$TMPFILE" "$BUFFER"' EXIT ABRT QUIT TERM
# Don't load the server all at once. With NTP-synchronized time, and
# thousand clients, it would make spikes on the CPU graph and that's not
# nice.
sleep $(( $(tr -cd 0-9 </dev/urandom | head -c 8) % 120 ))
sleep $(( $(tr -cd 0-9 </dev/urandom | head -c 8 | sed -e 's/^0*//' ) % 120 ))
cp /tmp/logs.last.sha1 "$TMPFILE" || true
# Grep regexp: Month date time hostname daemon
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment