From e12bd7bcaefb7df2ece674077c1e887c590d9dcc Mon Sep 17 00:00:00 2001 From: Jeffrey Lin Date: Sun, 19 Jan 2020 19:06:19 -0500 Subject: [PATCH] base/libc.jl: fix crash when run before epoch (#34056) --- base/libc.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/libc.jl b/base/libc.jl index 7ed0e937fde09..379c76dfd8c60 100644 --- a/base/libc.jl +++ b/base/libc.jl @@ -398,6 +398,6 @@ rand(::Type{Float64}) = rand(UInt32) * 2.0^-32 Interface to the C `srand(seed)` function. """ -srand(seed=floor(time())) = ccall(:srand, Cvoid, (Cuint,), seed) +srand(seed=floor(Int, time()) % Cuint) = ccall(:srand, Cvoid, (Cuint,), seed) end # module