diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-03 19:03:58 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-03 19:03:58 +0000 |
| commit | 4325214d8231b9dded2fa3619bb32c8417971fa5 (patch) | |
| tree | 5ecc4101ac3f6bd4817e15e4d307b42d2733b4c7 /util/nvmutil | |
| parent | 668dec36e91f2b35660767a20da07e8fbf123087 (diff) | |
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>
Diffstat (limited to 'util/nvmutil')
| -rw-r--r-- | util/nvmutil/nvmutil.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 9a28cf4f..ca7f328f 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -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; |
