Skip to content

Commit 1596175

Browse files
anaveragehumanKristofferC
authored andcommitted
base/libc.jl: fix crash when run before epoch (#34056) (#34442)
(cherry picked from commit f68753c)
1 parent 8683bfc commit 1596175

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

base/libc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,6 @@ rand(::Type{Float64}) = rand(UInt32) * 2.0^-32
398398
399399
Interface to the C `srand(seed)` function.
400400
"""
401-
srand(seed=floor(time())) = ccall(:srand, Cvoid, (Cuint,), seed)
401+
srand(seed=floor(Int, time()) % Cuint) = ccall(:srand, Cvoid, (Cuint,), seed)
402402

403403
end # module

0 commit comments

Comments
 (0)