mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-12 15:03:41 +00:00
all: use unsafe.SliceData where appropriate
This commit is contained in:
committed by
Ron Evans
parent
de83d67364
commit
70a0dee8c8
@@ -15,7 +15,7 @@ func GetRandom(p []byte, flags GetRandomFlag) (n int, err error) {
|
||||
if len(p) == 0 {
|
||||
return 0, nil
|
||||
}
|
||||
libc_arc4random_buf(unsafe.Pointer(&p[0]), uint(len(p)))
|
||||
libc_arc4random_buf(unsafe.Pointer(unsafe.SliceData(p)), uint(len(p)))
|
||||
return len(p), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user