mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
util/nvmutil: tidy up rhex()
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -436,13 +436,12 @@ rhex(void)
|
||||
static size_t n = 0;
|
||||
|
||||
if (!n) {
|
||||
#ifdef HAVE_ARC4RANDOM
|
||||
arc4random_buf(rnum, sizeof(rnum));
|
||||
#else
|
||||
read_file_PERFECTLY_or_die(rfd, rnum, sizeof(rnum),
|
||||
0, rname, NULL);
|
||||
#endif
|
||||
n = sizeof(rnum);
|
||||
#ifdef HAVE_ARC4RANDOM
|
||||
arc4random_buf(rnum, n);
|
||||
#else
|
||||
read_file_PERFECTLY_or_die(rfd, rnum, n, 0, rname, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
return rnum[--n] & 0xf;
|
||||
|
||||
Reference in New Issue
Block a user