Skip to content

Commit

Permalink
base/libc.jl: fix crash when run before epoch (#34056) (#34442)
Browse files Browse the repository at this point in the history
(cherry picked from commit f68753c)
  • Loading branch information
anaveragehuman authored and KristofferC committed Jan 21, 2020
1 parent 8683bfc commit 1596175
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/libc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1596175

Please sign in to comment.