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 ca640df commit c06c8bd
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 c06c8bd

Please sign in to comment.