util/nvmutil: make rhex err_if consistent

n + 1 is the same as saying sizeof(rnum) in this case.
we should be clear about that, in code. n is irrelevant
here, since it is only an index for the return value.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-03 19:03:58 +00:00
parent 668dec36e9
commit 4325214d82
+2 -1
View File
@@ -368,7 +368,8 @@ rhex(void)
if (!n) {
n = sizeof(rnum) - 1;
err_if(read(rfd, (uint8_t *) &rnum, n + 1) != sizeof(rnum));
err_if(read(rfd, (uint8_t *) &rnum, sizeof(rnum))
!= sizeof(rnum));
}
return rnum[n--] & 0xf;