From 4325214d8231b9dded2fa3619bb32c8417971fa5 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 3 Mar 2026 19:03:58 +0000 Subject: 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 --- util/nvmutil/nvmutil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.1