Fix build - potential use before initialization

Change-Id: I5d9db13b0241af64fa8e9eb9528a6e460166f280
This commit is contained in:
Ashod Nakashian 2019-06-21 17:33:56 -04:00 committed by Michael Meeks
parent 13469e8b00
commit e7cec81846

View file

@ -117,7 +117,7 @@ namespace Util
// a poor fallback but something.
std::vector<char> random = getBytes(length);
int fd = open("/dev/urandom", O_RDONLY);
int len;
int len = 0;
if (fd < 0 ||
(len = read(fd, random.data(), length)) < 0 ||
size_t(len) < length)