aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/random.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/util/random.lua b/util/random.lua
index 328bdb00..5938a94f 100644
--- a/util/random.lua
+++ b/util/random.lua
@@ -31,8 +31,8 @@ local function seed(x)
end
local function bytes(n)
- if #buffer < n then seed(uniq_time()); end
- local r = buffer:sub(0, n);
+ if #buffer < n+4 then seed(uniq_time()); end
+ local r = buffer:sub(1, n);
buffer = buffer:sub(n+1);
return r;
end