1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

rand: fix compilation on linux

This commit is contained in:
Alexander Medvednikov 2020-05-20 21:14:17 +00:00
parent ca81442fac
commit cd07429cc1

View File

@ -18,7 +18,7 @@ pub fn read(bytes_needed int) ?[]byte {
// getrandom syscall wont block if requesting <= 256 bytes
if bytes_needed > read_batch_size {
no_batches := int(math.floor(f64(bytes_needed/read_batch_size)))
for i:=0; i<no_batches; i++ {
for i:=0; i < no_batches; i++ {
if getrandom(read_batch_size, buffer+bytes_read) == -1 {
return read_error
}