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
  • Loading branch information
anaveragehuman authored and KristofferC committed Jan 20, 2020
1 parent a3ee6fe commit f68753c
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 f68753c

Please sign in to comment.