summaryrefslogtreecommitdiff
path: root/util/nvmutil
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2022-12-03 11:58:07 +0000
committerLeah Rowe <leah@libreboot.org>2022-12-03 11:58:07 +0000
commitededa5dddac36bdae4254b3ea6e8c51737c97a68 (patch)
tree0ec2ecc645286fbeaedf55cba3514788cea91e4f /util/nvmutil
parente2e321fc2013086f0bdb6a011159f201a06d1b06 (diff)
util/nvmutil: rename variables in hextonum
Diffstat (limited to 'util/nvmutil')
-rw-r--r--util/nvmutil/nvmutil.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c
index 4a021654..acaf5a98 100644
--- a/util/nvmutil/nvmutil.c
+++ b/util/nvmutil/nvmutil.c
@@ -218,18 +218,18 @@ hextonum(char chs)
{
uint8_t val8, ch;
static int macfd;
- static uint8_t *rmac = NULL;
- static size_t random;
- if (random == BUFSIZ) {
+ static uint8_t *rbuf = NULL;
+ static size_t rindex;
+ if (rindex == BUFSIZ) {
close(macfd);
- free(rmac);
- rmac = NULL;
+ free(rbuf);
+ rbuf = NULL;
}
- if (rmac == NULL) {
- random = 0;
- if ((rmac = (uint8_t *) malloc(BUFSIZ)) == NULL)
+ if (rbuf == NULL) {
+ rindex = 0;
+ if ((rbuf = (uint8_t *) malloc(BUFSIZ)) == NULL)
err(1, NULL);
- if (readFromFile(&macfd, rmac, "/dev/urandom", O_RDONLY,
+ if (readFromFile(&macfd, rbuf, "/dev/urandom", O_RDONLY,
BUFSIZ) != BUFSIZ) {
warn("%s", "/dev/urandom");
return 16;
@@ -244,7 +244,7 @@ hextonum(char chs)
} else if ((ch >= 'a') && (ch <= 'f')) {
val8 = ch - 'a' + 10;
} else if (ch == '?') {
- val8 = rmac[random++] & 0xf;
+ val8 = rbuf[rindex++] & 0xf;
} else {
return 16;
}