mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-10 15:20:56 +00:00
Include error in randomness failure panic
This commit is contained in:
parent
957643f523
commit
c96c78892d
@ -49,9 +49,9 @@ func randomString(l int) string {
|
||||
// randomInt64 returns a strongly random int64, slowly
|
||||
func randomInt64() int64 {
|
||||
var bs [8]byte
|
||||
n, err := io.ReadFull(cryptoRand.Reader, bs[:])
|
||||
if n != 8 || err != nil {
|
||||
panic("randomness failure")
|
||||
_, err := io.ReadFull(cryptoRand.Reader, bs[:])
|
||||
if err != nil {
|
||||
panic("randomness failure: " + err.Error())
|
||||
}
|
||||
return seedFromBytes(bs[:])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user