mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-18 14:12:44 +02:00
util/nvmutil: clean up rhex()
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -140,10 +140,9 @@ rhex(void)
|
||||
{
|
||||
static int rfd = -1, n = 0;
|
||||
static uint8_t rnum[16];
|
||||
if (!n) {
|
||||
xopen(rfd, "/dev/urandom", O_RDONLY);
|
||||
xopen(rfd, "/dev/urandom", O_RDONLY);
|
||||
if (!n)
|
||||
xpread(rfd, (uint8_t *) &rnum, (n = 15) + 1, 0, "/dev/urandom");
|
||||
}
|
||||
return rnum[n--] & 0xf;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user